Find age from two dates

# Thread: Find age from two dates

1. jd
Senior Member
Join Date
Dec 1969
Posts
850

## Find age from two dates

Is there a way to subtract two dates to determine someones age, I do the following but it does not account for leap years?<BR><BR>age = datediff("d",rstemp("dob"),date)<BR>age = age / 365<BR>age = left(age,2)<BR>

2. DF Guest

## RE: Find age from two dates

What about using y instead of d, this should give you the difference in years taking into account leap years as it is you code Day /365 that ignores leap years not the datediff function I think. <BR><BR>Normal year = 365<BR>Leap year = 366

3. Senior Member
Join Date
Dec 1969
Posts
1,229

## RE: Find age from two dates

Divide by 365.25

4. Senior Member
Join Date
Dec 1969
Posts
1,229

## RE: Find age from two dates

Divide by 365.25

5. jd
Senior Member
Join Date
Dec 1969
Posts
850

## RE: Find age from two dates

Didn&#039;t work when dob is 12/1/2000 and current date is 1/22/2001 answer would be one year.

6. Junior Member
Join Date
Dec 1969
Posts
13

## RE: Find age from two dates

Works great

#### Posting Permissions

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