select Datediff(day,cast("2010-01-01" as datetime),getdate())//返回2010-01-01与当前时间相差的天数
select Datediff(month,cast("2010-01-01" as datetime),getdate())//返回2010-01-01与当前时间相差的月数
select Datediff(year,cast("2010-01-01" as datetime),getdate())//返回2010-01-01与当前时间相差的年数