jo***@graham.ca wrote in
news:11**********************@g47g2000cwa.googlegr oups.com:
I have a table of items, with revision numbers. I need to
extract the items with highest revision number. The items may
be listed several times and I don't know what the highest
revision number for each item is. How do I do this?
This requires a subquery, to select the max() of revision from each
Item.
select item, revision from table where revision IN (SELECT max
(revision) from table where ITEM = [ITEM])
Or you can use the Dmax() function:
SELECT Item, revision FROM table WHERE
revision = dmax("revision","table","Item = '" & [item] & "'")
This may prove too slow, so you can instead make a permanent totals
query that groups by the item,and the max(revision) and do an inner
join back to the main table in a second query.
--
Bob Quintal
PA is y I've altered my email address.