converting minutes to hour:minutes:second in sql

后端 未结 2 1249
孤城傲影
孤城傲影 2020-12-22 14:37

I have a table transaction like this:

transactID    Paydate                   DelDate                     vtid
24            2013-05-08 16:53:03         


        
2条回答
  •  醉酒成梦
    2020-12-22 15:16

    marc_s is right with his comment. What you need is a function like in this answer.

    You would then call it like this:

    SELECT 
         udfTimeSpanFromSeconds(SUM(DATEDIFF(SECOND, t.Paydate, t.DelDate))) AS 'HH:MM:SS'
    FROM 
         Transaction_tbl t 
    WHERE 
         t.transactID in (24, 25) 
    group by 
         vtid 
    

提交回复
热议问题