DateDiff calculating wrong number of days

G

Guest

I don't know if I'm doing this wrong..but it seems as if the datediff is
adding 6 extra days. I'm using it in a query as this:
DateDiff("d", [DOB], [Date of Entry])

The DOB field is 12/28/80 and the Date of Entry field is 12/30/02
The result should be 8028 but instead is showing up 8034.
Am I doing something wrong or forgetting something?

Let me know any ideas!!!
 
G

Guest

It shouldn't be that though....right?
If you figure 365*22=8030-2=8028

Seems weird.

mscertified said:
I tried it on my PC and I got 8037

Dorian

JB said:
I don't know if I'm doing this wrong..but it seems as if the datediff is
adding 6 extra days. I'm using it in a query as this:
DateDiff("d", [DOB], [Date of Entry])

The DOB field is 12/28/80 and the Date of Entry field is 12/30/02
The result should be 8028 but instead is showing up 8034.
Am I doing something wrong or forgetting something?

Let me know any ideas!!!
 
G

Guest

You are forgetting leap years.
--
Thanks,
Steve


JB said:
It shouldn't be that though....right?
If you figure 365*22=8030-2=8028

Seems weird.

mscertified said:
I tried it on my PC and I got 8037

Dorian

JB said:
I don't know if I'm doing this wrong..but it seems as if the datediff is
adding 6 extra days. I'm using it in a query as this:
DateDiff("d", [DOB], [Date of Entry])

The DOB field is 12/28/80 and the Date of Entry field is 12/30/02
The result should be 8028 but instead is showing up 8034.
Am I doing something wrong or forgetting something?

Let me know any ideas!!!
 
J

John Spencer

Why are you subtracting 2 days - you should be adding 2 days.

365 * 22 = 8030
+ 5 leap years = 8035
+ 2 more days = 8037


Steve said:
You are forgetting leap years.
--
Thanks,
Steve


JB said:
It shouldn't be that though....right?
If you figure 365*22=8030-2=8028

Seems weird.

mscertified said:
I tried it on my PC and I got 8037

Dorian

:

I don't know if I'm doing this wrong..but it seems as if the datediff
is
adding 6 extra days. I'm using it in a query as this:
DateDiff("d", [DOB], [Date of Entry])

The DOB field is 12/28/80 and the Date of Entry field is 12/30/02
The result should be 8028 but instead is showing up 8034.
Am I doing something wrong or forgetting something?

Let me know any ideas!!!
 

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

Top