Using DateDiff to get decimal ages 
Author Message
 Using DateDiff to get decimal ages

Hi all,

Why is it that this code returns a whole number and not a decimal number? I
am trying to calculate a decimal age from the client's DOB?

lngAge = (DateDiff("d", rsClientDetails![DOB], [Date])) / 365.25

Thanks in advance,

Peter



Tue, 13 Jan 2004 14:51:33 GMT  
 Using DateDiff to get decimal ages
Is your variable lngAge perhaps defined as a Long?
If so, it's a whole number. Try a Single or Double type.

Quote:

> Why is it that this code returns a whole number and not a decimal number? I
> am trying to calculate a decimal age from the client's DOB?

> lngAge = (DateDiff("d", rsClientDetails![DOB], [Date])) / 365.25

--
Perth, Western Australia
Tips for MS Access users at:
        http://odyssey.apana.org.au/~abrowne


Tue, 13 Jan 2004 15:07:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Calculating Correct Ages & DateDiff

2. vbscript newbie needs help using DateDiff - getting headache tryi ng to figure out logic

3. basica - from XT-age to Pentium-age

4. DateDiff using multiple controls....hhheeelllppp PLEASE.

5. Calculating Time Difference using DateDiff Function in VBScript

6. Using DateDiff to calculate differences in minutes

7. Using the DateDiff function

8. Using Datediff

9. VBRUN300.dll crashes using DateDiff

10. Using DATEDIFF in Crystal Rpts 7.0

11. Using DateDiff

12. Calculating Age using date selected by User

 

 
Powered by phpBB® Forum Software