I am creating a query that has to calculate the average time that a hospital room sits empty before the next case is brought in. I need the average for each room and right now my query is giving me the average overall, instead of by room. Here's the query:
Does anyone know how to calculate the average for each room? It would help me out a lot. Thanks.
Code:
SELECT PerMonInput.OR_Suite_Number, PerMonInput.Turnover_Time, Count(ORNumber.ORID) AS ORCount, Format([Turnover_Time]/[ORID],"hh:nn:ss") AS TOAVg
FROM ORNumber INNER JOIN PerMonInput ON ORNumber.ORID = PerMonInput.OR_Suite_Number WHERE [ORID] =[OR_Suite_Number]
GROUP BY PerMonInput.OR_Suite_Number, PerMonInput.Turnover_Time, Format([Turnover_Time]/[ORID],"hh:nn:ss")
ORDER BY PerMonInput.OR_Suite_Number;
Does anyone know how to calculate the average for each room? It would help me out a lot. Thanks.