I'm a novice at formulas in Access and I'm not getting the age based on
the
formula I typed:
=DateDiff("yyyy",[Birthdate],(7/1/2004))+(Format([Birthdate],"mmdd")>Format((7/1/2004),"mmdd"))
Also, I may not have been clear in my initial post. I want the age of a
student based on the month of July. Can the formula be writte to always
base
it on the month of July. For instance the school year runs from July to
June. If the student is born April 1, 1999, I'm looking to get the age as
of
July 1, 2004.
Can you advise what I'm doing wrong and help me correct the formula?
Rick B said:
To calculate the current age...
DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(
),"mmdd"))
To calcualte from a specific date, just replace both instances of
"Date()"
with the field that contains the date you want to compare or with the set
date if that is applicable...
DateDiff("yyyy",[Birthdate],[SomeOtherDateField])+(Format([Birthdate],"mmdd"
)>Format(SomeOtherDateField],"mmdd"))
Rick B
--Viewpoint said:
Within the report function of Access, what is the formula for
calculating age
based on a specific day (i.e., Birtdate is December 12, 2001 and what
is the
age based on the date of July 1, 2004).