日期:2014-05-18 浏览次数:20523 次
--数据库没有24点 select datediff(hour,'2012-07-10 12:00:00','2012-07-11 23:00:00')/24.0 --1.458333 select datediff(hour,'2012-07-10 12:00:00','2012-07-12 00:00:00')/24.0 --1.500000
------解决方案--------------------
select ltrim(datediff(ss,@t1,@t2)1.0/24/3600)+'天'
------解决方案--------------------
select ltrim(cast(datediff(ss,'2012-07-10 12:00:00','2012-07-12 00:00:00')/24.0/3600 as dec(18,1)))+'天'