Age of a group for a fix day

T

Telesphore

How to calculate the age of the persons of a group for a precise day?

Example: what age do each one will have on July 1st 2008?

Thank you
 
F

fredg

How to calculate the age of the persons of a group for a precise day?

Example: what age do each one will have on July 1st 2008?

Thank you

Specifically July 1st 2008?
In a query:
Age: DateDiff("yyyy", [DOB], #7/1/2008#) - IIF(Format([DOB],
"mmdd") Format(#7/1/2008#, "mmdd"), 1, 0)

Directly as the control source of an unbound control:
=DateDiff("yyyy",[DOB],#7/1/2008#)-IIf(Format([DOB],
"mmdd")>Format(#7/1/2008#,"mmdd"),1,0)

Where [DOB] is the birthdate field.
OK that's for July 1, 2008.
Now what do you do in 2009, 2010, etc.?

Change #7/1/2008# to
DateSerial(Year(Date()),07,01)
to have the value re-computed each January without user intervention.

You do know, I hope, that this Age computation should NOT be stored
in any table. Just compute it and display it on a form or report, as
needed.
 

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

Similar Threads


Top