How do I calculate age on a report?

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

Guest

I have a table with Name and date of birth. I have a cattle show say on 24
April 05 . How do I prepare a report that will show the animals age at show
date?
 
I have a table with Name and date of birth. I have a cattle show say on 24
April 05 . How do I prepare a report that will show the animals age at show
date?

In a query:
Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
Format(Date(), "mmdd"), 1, 0)

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

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.
 
Back
Top