Datediff Help

M

Max

Hello everyone

I'm using the following formula to calculate date difference in a query:


DaysDiff: DateDiff('d',[Date1],[Date2])


Date1 Date2 DaysDiff
10/14/2009 12/06/2009 40147

But is not giving me the right number of days?

Please not the date format in the main table is Date/Time.

Thanks
 
W

Wayne-I-M

Hi

Change it to this (best bet would be to cut and paste)

DaysDiff: DateDiff("d", [Date1], [Date2])
 
J

John W. Vinson

Hello everyone

I'm using the following formula to calculate date difference in a query:


DaysDiff: DateDiff('d',[Date1],[Date2])


Date1 Date2 DaysDiff
10/14/2009 12/06/2009 40147

But is not giving me the right number of days?

Please not the date format in the main table is Date/Time.

Thanks

Since:

?dateadd("d", -40147, #12/06/2009#)
1/5/1900

and since 12/30/1899 is the zero point of the date system, I strongly suspect
that one or both of the "dates" are being interpreted as fractions (10 divided
by 14 divided by 2009).

What are the *datatypes* of Date1 and Date2 in the table - the format is
absolutely irrelevant? What's the context: could you post the entire SQL of
the query?
 
D

De Jager

Max said:
Hello everyone

I'm using the following formula to calculate date difference in a query:


DaysDiff: DateDiff('d',[Date1],[Date2])


Date1 Date2 DaysDiff
10/14/2009 12/06/2009 40147

But is not giving me the right number of days?

Please not the date format in the main table is Date/Time.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top