开发者

Calculating age based on a birthdate in MS access

开发者 https://www.devze.com 2023-01-26 22:10 出处:网络
I want to calculate a persons age based on a birthdatein ms access this is what i have tried 开发者_Python百科DateDiff(\"yyyy\", [birthdate], Now())+ Int( Format(now(), \"ddmm\") < Format( [birthd

I want to calculate a persons age based on a birthdate in ms access this is what i have tried

开发者_Python百科DateDiff("yyyy", [birthdate], Now())+ Int( Format(now(), "ddmm") < Format( [birthdate], "ddmm") )

But it gives me the error:

The expression you entered contains invalid syntax.

Can anyone tell me what's wrong and how to change it?


From: http://www.tek-tips.com/faqs.cfm?fid=85

''True = -1, False = 0
Age = DateDiff("yyyy", Birthdate, Date) + _
             (Date < DateSerial(Year(Date), Month(Birthdate), Day(Birthdate)))
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号