sql 根据身份证号码计算年龄

select PersonalId ,FLOOR(DATEDIFF(DY, substring(PersonalId,7,4), GETDATE()) / 365.25) from ConstructionInfo 

猜你喜欢

转载自www.cnblogs.com/xiaonangua/p/10735855.html