用sqlserver查询表中数据的时间与当前时间相差多少天

如题所述

第1个回答  2015-12-19
Select datediff(day,getdate(),表中日期时间) from 表本回答被网友采纳
第2个回答  2015-12-20
Year(getdate()) --当前年
Month(getdate()) --当前月
Day(getdate()) --当前日

Datediff(d,时间字段,getdate()) --得到离过生日还剩的天数本回答被网友采纳
第3个回答  2018-03-13
360建议关闭的。。
相似回答