Either use a query, add your table and these two fields, activate the
grouping function (press the Greek S, sum symbol) and assign the
function Max to your date field.
That's true. The MAX operator should be used, not the LAST operator. More
often than not, however, its necessary to return more than the two columns,
in which case a subquery can be used to restrict the outer query to the rows
with the latest date per product, e.g.
SELECT *
FROM Orders As O1
WHERE ShippedDate =
(SELECT MAX(ShippedDate)
FROM Orders As O2
WHERE O2.ProductID = O1.ProductID);
Actually Last is rather misleading: it refers to the last record *IN DISK
STORAGE ORDER*, which might or might not be the latest chronological date. The
Max operator (in place of Last) would get the latest (not last) date.
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.