Thread: Get Top rows
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default Get Top rows

"Jim Thomlinson" wrote ...

I have a sheet with subtotals
for each product group. My columns a
PRODGROUP PART SUMOFPART COUNTOFQUOTE
So each product group might have 100 parts or more. Is
there a way to get lets say Top 25 rows for each product
group? I been trying to do such in Access too, but can't
seem to get it.

You could try removing the subtotals and aranging the data in a pivot table.


Here is a query to do the same as described for the Excel pivot e.g.
could be used in MS Access:

SELECT T1.PRODGROUP, T1.PART
FROM Products T1
WHERE 25 = (
SELECT COUNT(*) + 1
FROM Products
WHERE PRODGROUP = T1.PRODGROUP
AND PART T1.PART
) ORDER BY T1.PRODGROUP, T1.PART DESC;

Jamie.

--