开发者

Calculating age based on a birthdate in MS access

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜