SteveL13
asked on
How find top 3 records for each part number
I have a table named tblOpenOrders. The primary key field is named RecID. Also in the table is a field named Part_No. I am trying to write a query using query designer that finds the top three records in the table, with RecID being a number field FOR EACH part in Part_No.
So the resulting query might look like:
Part_No RecID
12345 98234
12345 97620
12345 97100
45612 99124
45612 99005
45612 98307
78451 97890
78451 96120 (sometimes there could be only 2 or 3 records for a given Part_No)
etc.
etc.
etc.
So the resulting query might look like:
Part_No RecID
12345 98234
12345 97620
12345 97100
45612 99124
45612 99005
45612 98307
78451 97890
78451 96120 (sometimes there could be only 2 or 3 records for a given Part_No)
etc.
etc.
etc.
ASKER
Yes, largest RecID.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You would need to do it with an initial query that gets you the PartNo's and then loop through the part numbers to get the top 3 records for each part number.
What do you mean by top 3 by the way? largest Recnum, or something else?