date

  • Thread starter Thread starter Guest
  • Start date Start date
DateDiff("yyyy", [Birthdate], Date()) - _
IIf(Format(Date(), "mmdd") < Format([Birthdate], "mmdd"), 1, 0)

The first part gives the difference in years between the 2 dates.
Unfortunately, the DateDiff function is a little too literal: it sees
2003/12/31 and 2004/01/01 as being one year apart, so it's necessary to add
the second part, which checks to see whether the birthday has already
occurred this year. If it has not, you subtract 1 from the value computed by
DateDiff.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


jos said:
how to tell access what age somebody has. by using birthdate and
systemdate?
 
Back
Top