MS Access: Summing time greater than 24 hours in query restarts from 1 again

前端 未结 3 1831
抹茶落季
抹茶落季 2020-12-12 07:37

I have a table trans_hist in MS Access program where time is stored in short Date format \"HH:MM\" ex:

[![Image][1]][1]

Now I have created a query which tell

3条回答
  •  一整个雨季
    2020-12-12 08:29

    I hope, this SQL query helps:

    SELECT T.UID,
           CSTR(total_hours 
                    + INT(total_min / 60)) 
                    + ":" 
                    + CSTR(total_min Mod 60) as result
    FROM
        (SELECT UID,
                SUM(HOUR(TH.time_elapsed)) AS total_hours,
                SUM(MINUTE(TH.time_elapsed)) AS total_min
        FROM trans_hist AS TH
        GROUP BY UID) AS T
    

提交回复
热议问题