Please help!! Top 3 Values by Group

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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%
 
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:
 
Back
Top