Results 1 to 4 of 4
  1. #1
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085

    Top 5 query by Group

    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?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Perfect thanks Paul just what I needed

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 06-21-2012, 07:40 PM
  2. Group title carrying forward to next group
    By Amandasr12 in forum Reports
    Replies: 3
    Last Post: 06-06-2012, 02:13 PM
  3. Help with 'group by' query
    By donbrown44 in forum Queries
    Replies: 3
    Last Post: 08-24-2011, 09:48 AM
  4. query group by over another group by?
    By gap in forum Queries
    Replies: 2
    Last Post: 07-04-2011, 12:59 AM
  5. columns for group detail but not group header?
    By Coolpapabell in forum Reports
    Replies: 0
    Last Post: 08-21-2009, 08:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums