How to convert Time to Decimal in SQL with an integer

后端 未结 3 1532
故里飘歌
故里飘歌 2021-01-26 18:14

I am having a couple of issues converting time to decimal...

Essentially I have used a DATEDIFF to identify the hours and minutes between two dates and times. This produ

3条回答
  •  灰色年华
    2021-01-26 18:33

    Get the time difference in minutes, and divide by 60, this will place hours before the decimal separator and minutes after:

    datediff(minute, startdate, enddate) / 60.0
    

提交回复
热议问题