Date of Birth to years old

Scolds

Registered User.
Local time
Today, 20:10
Joined
May 19, 2004
Messages
15
Using XP OS and Access 97 Date() - DOB = Age this is correct however on a NT OS any DOB within 2 weeks of today's day and month ie 10/05/59 shows the age 1 year younger. ie 44 where as the XP platform shows 45. The NT in Regional setting has the Gregorian Calender but this cannot be changed. As this db is being produced for other users does anyone know the way to solve this. Thanks in advance.
 
Please do a search before you ask such questions - this is one of those topics that gets asked over and over again for no reason.

Take the time to search the Code Repository forum also as there are numerous functions/expressions for calculating age from a date of birth.

Code:
Public Function Age(DOB As Date) As Integer
    Age = DateDiff("yyyy", DOB, Now()) + _
        Int(Format(Now(), "mmdd") < Format(DOB, "mmdd"))
End Function
 

Users who are viewing this thread

Back
Top Bottom