Calculating Age

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm trying to write a query that will pull the age of a person. If they were
born in March 2000 there age would be 4 but if they were born in January 2000
there age would be 5.
I need to include the month to give an accurate calculation

Thanks
 
Todd said:
Hi,

I'm trying to write a query that will pull the age of a person. If they
were
born in March 2000 there age would be 4 but if they were born in January
2000
there age would be 5.
I need to include the month to give an accurate calculation

The following will do it for you (No credit to me, this has been floating
around for years):

Age = DateDiff("yyyy", [DateOfBirth], Date()) - IIf(Format$(Date(), "mmdd")
< Format$([DateOfBirth], "mmd­d"), 1, 0)

Tom Lake
 
Back
Top