I am working on a query for a medical Group We're looking for the top 5 Specialists by Specialty for our group by net paid. I already have a query that returns The sum of net paid by specialty sorted descending. Say in the original query I have 15 Anesthesiologists and 11 Cardiologist
What I need is something like this.
Anesthesiologist Dr Smith $15,000
Anesthesiologist Dr Jones $14,990
Anesthesiologist Dr John $13,000
Anesthesiologist Dr Bill $12,000
Anesthesiologist Dr Ron $10,000
Cardiologist Dr George $89,000
Cardiologist Dr Kate $85,000
Cardiologist Dr Chris $70,000
Cardiologist Dr Rich $68,000
Cardiologist Dr Val $65,000
If I use Select top 5 I would only get the 5 Cardiologists and none of the Anesthesiologists. I need 5 of each specialty. Anybody know of a way to do this in a query or is VBA my only option?