Age Calculation - Error

  • Thread starter Thread starter Dave K
  • Start date Start date
D

Dave K

I am using the below formula on a DOB column in an update query. Am
getting large numbers (e.g., "11979" for the date of birth 1/16/1977)
as the results, rather than the member age I am intending to get. Does
anyone know what may be the problem?

DateDiff("y",[Birthdate],Now())
 
The first error is that you need "yyyy", not "y". "yyyy" gives the
difference in years, "y" gives it in days.

However, changing to "yyyy" won't be completely accurate, given how DateDiff
works (it counts the number of transitions encountered, so 31 Dec, 2009 to 1
Jan, 2010 is counted as one year, since the year has changed...)

For a more correct approach, see
http://www.mvps.org/access/datetime/date0001.htm at "The Access Web"
 
Back
Top