Access Caluculations of Age

B

BCNW

How do you make a DOB & Today's date automatically calculate age in a report?
I have the formulay for the table colums with is =[Todays Date]-[DOB]/365.25
but I don't know where to input it.
 
D

Douglas J. Steele

Actually, what you've got isn't always accurate, since there aren't 365.25
days in a year.

Better is DateDiff("yyyy", [DOB], Date()) - Iif(Format(Date(), "mmdd") <
Format([DOB], "mmdd"), 1, 0)

You can put that as a computed field in the query on which the report is
based, or you can use it as the Control Source for a text box on your report
(put an equal sign in front in the latter case)
 
Top