以18位居民身份证号码为例
SFZH="320705197803240519"
*----"年龄"提取方法:
DDATE=CTOD(STUFF(STUFF(SUBSTR(SFZH,7,8),5,0,"."),8,0,".")) &&将提取的出生日期字符串转换为日期型数据
NL=YEAR(DATE())-YEAR(DDATE)+IIF(MONTH(DATE())-MONTH(DDATE)>0,0,IIF(DAY(DATE())-DAY(DDATE)>=0,0,-1))
*----"性别"提取方法:
XB=IIF(MOD(VAL(SUBSTR(SFZH,17,1)),2)=1,"男","女")
身份证号码中,年龄、性别的提取方法
最新推荐文章于 2023-01-28 15:45:00 发布