# Thread: Calculating Age (Access 2003)

1. ## Calculating Age (Access 2003)

Can you help settle an argument, please?
We have a DB of club membership and want to be able to calculate age of a member at time of joining. We obviously capture date of birth.
Now it seems (to me) like calculating age is complicated, with leap years and all, but someone claims that all that needs to be done is :
Take DOB from Now() which gives number of days - then divide by 365.25 and take integer bit.
Is it really that simple?

2. ## Re: Calculating Age (Access 2003)

I believe it can fail in certain very specific (and rare) circumstances. That is, it can sometimes be off by like 1 day, which isn't a problem except if person's birthday happens to be today. For example, do the math on birthdate of 3/1/01 and a "today's" date of 3/1/06.

3. ## Re: Calculating Age (Access 2003)

Yes, it can be wrong by a day occasionally. Remember that a calendar year is NOT 365.25 days; it is 365 days 3 out of 4 years and 366 days 1 out of 4 years (I'm ignoring the "century rule"). The Access help provides an accurate age calculation -
=DateDiff("yyyy", [Birthdate], Now())+ Int( Format(now(), "mmdd") < Format( [Birthdate], "mmdd") )

4. ## Re: Calculating Age (Access 2003)

Another custom age function (this one from the Access 97 code samples database) is

Function Age(Bdate, DateToday) As Integer
' Returns the Age in years between 2 dates
' Doesn't handle negative date ranges i.e. Bdate > DateToday
Age = Year(DateToday) - Year(Bdate)
If Month(DateToday) < Month(Bdate) Or (Month(DateToday) = Month(Bdate) And Day(DateToday) < Day(Bdate)) Then
Age = Age - 1
End If
End Function

5. ## Re: Calculating Age (Access 2003)

Thank you Mark, Douglas and Hans
I knew it wasn't that simple!
Sorry for the delay in replying
Silverback

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•