sql 周岁计算

select  FLOOR(DATEDIFF(DY, substring(身份证字段,7,4), GETDATE()) / 365.25)  age  from [表名] 

原文地址:https://www.cnblogs.com/dcrenl/p/14778946.html