SELECT LastName
,BirthDate
,DATEDIFF(YEAR,BirthDate,GETDATE()) as ApproximateAge
,CONVERT(int,DATEDIFF(day,BirthDate,GetDate())/365.25) as Age
FROM SlateGravelEmployee
ORDER BY LastName
/*计算准备年龄用CONVERT(int,DATEDIFF(day,BirthDate,GetDate())/365.25) as Age因为:如果一个人的生日是12月31日 但是运行这个程序的日期为1-11 月的话。就会比实际年龄多一岁如果要寄送贺卡,本来是第该过53个生日 确会变成54个*/
得到客户的年龄Age