日期:2014-05-17 浏览次数:20555 次
select DATEDIFF(day,GETDATE(), last_test_date) from equip_regular_check order by 1
------解决方案--------------------
可以,你试试下面语句,不过按你的语句得出的是负数,我改下.
SELECT DATEDIFF(DAY,last_test_date,GETDATE()) AS RemainDay FROM equip_regular_check
ORDER BY RemainDay.
你试试
------解决方案--------------------
select *,datediff(dd,getdate(),last_test_date) as 剩余天数 from equip_regular_check order by datediff(dd,getdate(),last_test_date) asc
------解决方案--------------------
select datediff(day,getdate(),last_test_date) as 剩余天数 from equip_regular_check order by 1