gsr
10/22/2024, 11:46 PMSELECT
CONCAT(
FLOOR(total_seconds / 60),
':',
LPAD(MOD(total_seconds, 60), 2, '0')
) AS total_time
FROM (
SELECT
SUM(
CAST(SUBSTRING_INDEX(mind, ':', 1) AS UNSIGNED) * 60 +
CAST(SUBSTRING_INDEX(mind, ':', -1) AS UNSIGNED)
) AS total_seconds
FROM
stats
WHERE
ID IN (174)
) AS subquery;
my cf solution
its totally wrong
https://trycf.com/gist/6963fed15361103dc8780febec71c0a3/lucee5?theme=monokaiTomy Saman
10/23/2024, 5:02 AMvar seconds = val("0." & parts[2]) * 60;
By the look of your question and your SQL, you're treating the 2nd part of your data as the second itself
But in your function you are making them as decimal and then multiply them by 60
So 0.17 should be 17 seconds, but you are doing 0.17 * 60 (so you are treating 0.17 as 0.17 minute, not 17 seconds)
Change it to multiply by 100 should fix it
Or just var seconds = val( parts[2] );gsr
10/23/2024, 10:15 AMgsr
10/23/2024, 10:33 AMgsr
10/23/2024, 10:48 AMgsr
10/23/2024, 10:59 AMEvil Ware
10/23/2024, 12:09 PMgsr
10/23/2024, 12:15 PMgsr
10/23/2024, 12:31 PMEvil Ware
10/23/2024, 12:42 PMgsr
10/23/2024, 12:44 PMgsr
10/23/2024, 12:44 PMEvil Ware
10/24/2024, 12:50 PMgsr
10/24/2024, 12:56 PM