Convert HH:MM:SS string to number of minutes

后端 未结 8 617
醉梦人生
醉梦人生 2021-01-22 12:03

I have the below query.

select cast(dateadd(minute, datediff(minute, TimeIn, TimeOut), 0) as time(0) )

I get the results from two columns in th

8条回答
  •  无人及你
    2021-01-22 13:02

    For SQL Server (works for 2005 too):

    select Datediff(mi,convert(datetime,'00:00:00',108), convert(datetime,'02:47:00',108))
    

提交回复
热议问题