LAST of MAX records in query

G

Guest

i have records that have ocasional "duplicates". These are 6-digit work
orders. I need a query to retrieve all of the last or max records for EACH
entered work order. this might have to be laid out to use the autornumbered
ID fireld to make a duplicate work order the last or max. So the final result
will be ALL work orders, and any WO's that have duplicates are represented by
the lated record only. An example is below

EXISTING LIST
WO# | (autonum) ID
--------------------------------------------
123456 0001
123457 0002
123457 0003
123458 0004
123459 0005
123460 0006
123460 0007
123460 0008
123461 0009
123462 0010


NEW LIST
WO# | (autonum) ID
--------------------------------------------
123456 0001
123457 0003
123458 0004
123459 0005
123460 0008
123461 0009
123462 0010
 
B

Brian Camire

You might try a query whose SQL looks something like this:

SELECT
[WO#],
Max([ID]) AS [Max ID]
FROM
[Your Table]
GROUP BY
[WO#]
 

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

Top