作者在 2015-02-17 21:07:47 发布以下内容
Year(Date())-Year(DDate)+IIF(MONTH(Date())-MONTH(DDate)<0,-1,IIF(Day(Date())-Day(DDate)>=0,0,-1))
Year(Date())-Year(DDate)+IIF(MONTH(Date())-MONTH(DDate)<0,-1,IIF(Day(Date())-Day(DDate)>=0,0,-1))
如果 出生年月 是以日期型数据的类型保存的,如 1989-05-21,则计算周岁年龄的公式为:
YEAR(DATE()) - YEAR(出生年月) + IIF(DATE(YEAR(DATE()), MONTH(出生年月), DAY(出生年月)) <= DATE(), 0, -1)