Query top 20 records of multiple Product Codes Category

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

Guest

Hi, I am having problems querying the top 20 records (PARTID's) from about 35
product codes. these Part ID's are the highest AMD in each Product code
category. I can only get the first top 20 records at a time but I would like
to run the query to show the top 20 for all 35 or so product codes in one
single queries. Below is my exact query I am using to get all the records
that I need to show the top 20 records.

SELECT DemandAmd_Combined.PCode, DemandAmd_Combined.ITEM,
DemandAmd_Combined.TotAmd, OnHandCombined.AvailQty, [AvailQty]/[TotAmd]*30 AS
DSO
FROM DemandAmd_Combined LEFT JOIN OnHandCombined ON
DemandAmd_Combined.ITEM=OnHandCombined.PART

Thanks in advance, Ray
 
Ray said:
Hi, I am having problems querying the top 20 records (PARTID's) from about 35
product codes. these Part ID's are the highest AMD in each Product code
category. I can only get the first top 20 records at a time but I would like
to run the query to show the top 20 for all 35 or so product codes in one
single queries. Below is my exact query I am using to get all the records
that I need to show the top 20 records.


Here's Allen Browne's response to a similar question last
week:

See:
How to Create a "Top N Values Per Group" Query
at:
http://support.microsoft.com/?id=210039


If this is for a report, you may also want to check:
How to create a top values per group report
at:
http://support.microsoft.com/?id=208822
 
Back
Top