62,047
社区成员
发帖
与我相关
我的任务
分享
SELECT * FROM [A] WHERE datediff(dd, getdate(), [DT_time] ) < a ORDER BY [ID] DESC
-- or
SELECT * FROM [A] WHERE datediff(dd, dt, [DT_time]) < a ORDER BY [ID] DESC
declare @a int
set @a=3
select * from [A] where DT_time-getdate()<@a order by [ID]