MS97: Date Calculation

  • Thread starter Thread starter Mark
  • Start date Start date
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?
 
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)
 
Back
Top