Please help!! Top 3 Values by Group

K

K Reinhold

I have query called qry_top_three_percents. I need to return the top 3 percents for each group type. Please help!! The structure looks like the following:

Group_Type Code_Q8 Code_Percent
Dept 1 1 54%
Dept 1 6 20%
Dept 1 11 10%
Dept 1 24 5%
Dept 1 42 2%
Dept 2 1 36%
Dept 2 24 14%
Dept 2 6 10%
Dept 2 37 6%
 
K

Ken Snell

Something like this should work:

SELECT A.Group_Type, A.Code_Percent
FROM Table1 as A
WHERE A.Item IN
(Select Top 3 B.Code_Percent
From Table1 as B
Where B.Group_Type = A.Group_Type)
Order By A.Group_Type;


--
Ken Snell
<MS ACCESS MVP>

K Reinhold said:
I have query called qry_top_three_percents. I need to return the top 3
percents for each group type. Please help!! The structure looks like the
following:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top