birthday - age

agorman

Registered User.
Local time
, 16:04
Joined
Dec 30, 2006
Messages
68
Hi,

Is there an easy way that I can run a query to find the age of a person based on their DOB ?

(ie = 31/3/58 would show as 51)

Thanks

Adrian
 
This subject has come up many times before. Search this Forum for "DOB", and you will find examples of what you are looking for.
 
Got one - thanks, thought it was just me who struggles
 
Hi -

Can't tell what you found, but just a word of caution:

A common error in determining age is to merely subtract year of birth from current year in the belief that this gives age. Using the DateDiff() function works in this manner. Your example is a good example, i.e. DOB = 31 Mar 58 versus today's date of 24 Feb 09. You stated the age as 51, when in fact the individual won't turn 51 until 31 Mar 09.

Ensure that the sample you found accounts for this possibility.

Bob
 
I found this

DateDiff("yyyy", [DateofBirth], Now())+ Int( Format(now(), "mmdd") < Format( [DateofBirth], "mmdd") )

seems to work great.

thanks
 
Yeah, that'll do it.

The Int(Format(now(), "mmdd") < Format( [DateofBirth], "mmdd") is a boolean statement which will equate to -1 when True, 0 when False.

Suggest you replace the Now() references, which gives both date and time, with Date(), since time doesn't play a part in determining age.

Bob
 

Users who are viewing this thread

Back
Top Bottom