Per another post from someone asking the same thing a month or so ago, first
is a clip of my post then the corrected answer from John Vinson. Hope that
helps. =)
=DateDiff("yyyy", [DOB], [DOE])
the "yyyy" will calculate the time is years. "d" Days and so on. DOB would
be the name of your field for Date of Birth and I used DOE for the name of
your field for Date of Expiration.
That will be close... but not absolutely accurate, at least by the traditional
use of "age". DateDiff actually counts year (or day, or second, or...)
boundaries, not full years; so if [DOB] were 12/31/1875 and [DOE] were
1/1/1876 - just a day later - the age would be reported as one year. Or if
[DOB] were 1/1/1931 and [DOE] 12/29/1931 - almost a year - you'ld still get 0.
You can correct for this with an expression:
DateDiff("yyyy", [DOB], [DOE]) - IIF(Format([DOE], "mmdd") > Format([DOB],
"mmdd"), 1, 0)
John W. Vinson [MVP]
Denise said:
I have a form where I need to calculate the age.
I have a text box for the DOB and a text box for the Date. I inserted a
text box to calculate the age from the Date of the event. I need to know
what formula will work. I have tried the following -
=([Date]-[DOB])/365 and I get #Error
Thanks for any help.