Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: date diff Post Reply Post New Topic
Author Message
bobsn
Newbie
Newbie


Joined: 19 Mar 2007
Online Status: Offline
Posts: 27
Quote bobsn Replybullet Topic: date diff
    Posted: 07 May 2007 at 1:52pm
Hi,
I am looking to find the difference between two date time fields in hh:mm format. Is there a function in Crystal XI that i could use directly?

any other ideas?

thanks

IP IP Logged
EscApe
Newbie
Newbie


Joined: 13 Nov 2006
Location: Finland
Online Status: Offline
Posts: 37
Quote EscApe Replybullet Posted: 11 May 2007 at 8:56am
DateDiff function calculates difference between two dates and it can return value as years, quarters, months, days, weeks, hours, minutes and so on.

Example:
DateDiff ("h", {Invoice.Orderdate}, CurrentDate)

-calculates how many hours has passed since order, value returned is full hours

First parameter can be i.e.:
"n" for minutes
"s" for seconds
"yyyy" for years
"q" for quarters

To convert numbers to time you can use Time function:
Time(DateDiff ("h", {Invoice.Orderdate}, CurrentDate), DateDiff ("m", {Invoice.Orderdate}, CurrentDate), 0)

-third parameter is for seconds
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.030 seconds.