34,838
社区成员




select datediff(hh,'2014-02-08 17:00','2014-02-08 18:10')
1
select datediff(n,'2014-02-08 17:00','2014-02-08 18:10')
70
select ceiling(datediff(minute,'2014-02-08 17:00','2014-02-08 19:05')/60.0)
/*
3
*/
[/quote]
select ceiling(datediff(minute,'2014-02-08 17:00','2014-02-08 18:10')/60.0)
/*
2
*/
select ceiling(datediff(minute,'2014-02-08 17:00','2014-02-08 19:05')/60.0)
/*
3
*/
select case when datediff(n,'2014-02-08 17:00','2014-02-08 18:10')%60>0
then datediff(hh,'2014-02-08 17:00','2014-02-08 18:10')+1
else datediff(hh,'2014-02-08 17:00','2014-02-08 18:10')
end
select case when datediff(n,'2014-02-08 17:00','2014-02-08 18:10')%60>1
then datediff(hh,'2014-02-08 17:00','2014-02-08 18:10')+1
else datediff(hh,'2014-02-08 17:00','2014-02-08 18:10')
end
select case when(cast(datediff(hh,'2014-02-08 17:00','2014-02-08 18:10') as int))>1 then 2 else datediff(hh,'2014-02-08 17:00','2014-02-08 18:10') end
供参考!