I have a Mysql table that stores dates in the format (YYYY-MM-DD HH: MM: SS).
What I want is the SUM part of HH: MM: SS for the selected rows, as I found in another post, I use the query
SELECT SEC_TO_TIME(SUM(TIME_TO_SEC(date))) FROM table
This request works. It summarizes the part I want and returns it in the format HH: MM: SS.
My question is whether it is possible to cut out seconds from the result.
I need to do this in the request, since the CMS I use does not allow me to use php for this part.
By the way, it would be great if I could return the result in days, hours and minutes, if the amount is more than 24 hours.
Thanks in advance
For everyone who is interested, I found a solution
SELECT TIME_FORMAT(SEC_TO_TIME(SUM(TIME_TO_SEC(hours))),'%H:%i' ) FROM table
source share