How to get the number of hours between start and end time when start time greater than endtime in SQL Server? -
How do I
start time = '23: 00 by getting the number of hours 00.0000000 '
and
expiration time = '07: 00: 00.0000000'
SQL server In? I tried to select the DATEDIFF (hour, '23: 00: 00.0000000 ',' 07: 00: 00.0000000 ')
but it returns the negative hour -16 .
I have to have the result 8 hours.
This is a way to:
Select when DATEDIFF (HOUR, '23: 00: 00', '07: 00: 00 ') & lt; 0 to 24 + DATEDIFF (HOR, '23: 00: 00', '07:00:00') LSEDED (HOR, '23: 00: 00 ', '07: 00: 00') ED
/ Pre>
Comments
Post a Comment