I have this query that I need to graph.
The graph will show Total patients, patient Longest wait (minutes) and patient Median wait for each location. I need to include Medians in my query, and that is where I am stuck.
Example Raw Data:
Query I have so far w/o Medians:
SELECT
[Location],
count([Patient_Number]) Total,
MAX([WaitTime_Min]) LongWait
FROM MyTable
where
[Location] in ('AMB', 'PEDS', 'WALK')
and [EDNurse] is NULL
group by [Location]
Output:
I need help getting a last column of Medians for WaitTime (from the raw data) for each location. Any help would be appreciated; Thanks!!
Desired Output: