Reputation: 1853
In the database, we have a numeric field that represents the total time in minutes for a doctor to evaluate a patient record. And, we have a report that groups by the doctor name and shows the total number of records in one column, the total number of minutes the doctor took to evaluate all of their records in a given time frame in the next column and the total average number of minutes it took for the doctor to evaluate their records during that time frame.
But, we have one customer who wants to see these numbers in hours, not minutes. Is there a way for me to do the division in the query or am I going to have to get the results in minutes and then divide by 60 for each doctor?
Upvotes: 1
Views: 104
Reputation: 272146
Something like:
SELECT doctor_id, SUM(minutes_spent) / 60 AS hours_spent
FROM that_table
GROUP BY doctor_id
Upvotes: 2