MS97: Date Calculation

M

Mark

I'm able to calculate the age from a date of birth field
using the DateDiff function below:

=DateDiff("yyyy",[fDoB],Date())

However this is a problem as the age is calculated based
on the difference between the year.

I want the age to be calculated depending on the day and
month as well.

Surely there is an easy solution....I just can't find it.

Little help?
 
J

John Vinson

I'm able to calculate the age from a date of birth field
using the DateDiff function below:

=DateDiff("yyyy",[fDoB],Date())

However this is a problem as the age is calculated based
on the difference between the year.

I want the age to be calculated depending on the day and
month as well.

Surely there is an easy solution....I just can't find it.

Try

=DateDiff("yyyy",[fDoB],Date()) - IIF(Format([fDoB], "mmdd") >
Format(Date(), "mmdd"), 1, 0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top