我想根据ms的访问次数计算一个人的年龄,这是我尝试过的
DateDiff("yyyy", [birthdate], Now())+ Int( Format(now(), "ddmm") < Format( [birthdate], "ddmm") )
但它给了我错误:
The expression you entered contains invalid syntax.
谁能告诉我什么是错的以及如何改变它?
答案 0 :(得分:2)
来自: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)))