Date/Age Field in Months

miacino

Registered User.
Local time
Today, 04:32
Joined
Jun 5, 2007
Messages
106
I'm trying to calculate a person's AGE in MONTHS but to the closest 1/2 month. (i.e., if someone is 37.1 months old it would be 37.5 vs. if they are 36.9 months it would be 36.5, etc.).

Can anyone help?
Thanks!
Michele
 
I think DateDiff("m",#BIRTHDAY DATE#,Date()) will get you the number of months... then just add .5 to it...

So something like: CDbl(DateDiff("m",[Birthday_Date_Field],Date()) & ".5")
 
It's not a rounding issue, from what I understand, since 36.9 does not round down to 36.5....

Using her examples: A datediff() function, calculated in Months, should yeild a whole month integer value... So: 36.9 would yeild 36... and 37.1 would yeild 37... at which point you should be able to concatenate a value of ".5", convert the whole thing to a double to get the closest mid-month number (i.e. 36.5 & 37.5, respectively)
 
GBLACK - thank you, thank you, thank you! Worked like a charm! Appreciate it!
 
GBLACK - thank you! thank you! thank you! Worked like a charm! :D
 

Users who are viewing this thread

Back
Top Bottom