[AccessD] Age calculation

Steve Schapel miscellany at mvps.org
Mon Jun 25 17:46:56 CDT 2007


Susan,

Susan Harkins wrote:

> Seems like it would be easy enough to run a simple check -- if it's a Feb 29
> birthdate and the date is Feb 28, add 1. 

... *and* if it's not a leap year.

Try this:
DateDiff("yyyy",[DOB],Date())+(Format([DOB,"mmdd")="0229" And 
Format(Date(),"mmdd")="0228" And 
Format(Date()+1,"mmdd")<>"0229"),"mmdd")>Format(Date(),"mmdd"))

Regards
Steve



More information about the AccessD mailing list