I would like to differentiate between two dates and round the result to the next day.
For exemple, if I have date1='2020-03-10 11:59:00'
and date2='2020-03-10 20:53:00'
, the difference between date1 and date2 with datediff()
is equal to 8 hours. I would like to round this result to have 24 hours.
EDIT
I tried by using dateadd()
like this :
select DATEADD(HOUR, DATEDIFF(HOUR, '2020-03-10 11:59:00', '2020-03-10 20:53:00'),0)
Return 1900-01-02 09:00:00.000
doesn't correspond to what I want.