If you want to get the sum of all charges on a ticket, you can do this:
SELECT tickets.subject, DPQL_ALIAS(CONCAT(FLOOR(tickets.charges.charge_time / 3600), ' Hours ', FLOOR(MOD(SUM(tickets.charges.charge_time), 3600) / 60), ' mins'), 'Charge Time')
FROM tickets
GROUP BY tickets.id AS 'ID'
Pridať komentár
Please log in or register to submit a comment.