Date Function

profxavier27809

Registered User.
Local time
Today, 00:05
Joined
Sep 8, 2005
Messages
11
Hello all,

Thanks first of all for all of the help I always receive in here. My question is I have to fields on a report simply reading from a query. They are Effective Date and Warning Delivered. These are formatted short date with an input mask of 07/12/05. I wondered if you knew of a function that, for example, if the effective date was 09/01/05 and the warning delivered was 09/03/05 that it would return a value that says 2 days. Thanks again in advance for your help or direction.

Sincerely,

Raymond
 
Look at the DateDiff() function.
 
datediff( "d" , date1, date2 )

This returns the date difference in days between date1 and date2.

You said the format is short date but if the data type is date&time just be careful for with the accuracy.

For example:
a task started: 01/01/2005 23:50:00
and completed: 02/01/2005 01:00:00

using datediff("d",date1,date2) would return 1, implying the task took 1 day.

using datediff("n" date1, date2) would return 70 (minutes) - A big difference from a day.

Hope this helps.
 

Users who are viewing this thread

Back
Top Bottom