Query last 3 Work Orders for Part Numbers

  • Thread starter Thread starter Deb
  • Start date Start date
D

Deb

I have a query that lists all our Part Numbers and the Work Orders that have
been created for those parts. I need to be able to display the 3 most recent
Work Orders for each part.
The data in would look like this:
Part A
WO1
WO2
WO3
WO4
WO5
Part B
WO6
WO7
WO8
WO9
WO10
Resulting data from the query would be:
Part A
WO5
WO4
WO3
Part B
WO10
WO9
WO8
Does anyone have suggestions on how I could accomplish this task? Thank you
in advance for any help!
Deb
 
Sort Ascendingly for the Part Numbers.
Descendinly for the Work orders.

go to the SQL view... between the keyword SELECT and the first field, insert

Top 3

You may have to play with it a little since you're using 2 fields.. You may
have to make a query that only has Part #'s and work order #'s first and then
join that to the detail.

Also might have to add DISTINCTROW after the TOP 3 so it doesn't just pick
up the top 3 records, rather the top 3 in each part #..
 

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

Back
Top