Selecting Specific Records

B

Bev

I want to select the last record for each item as follows:

Date
Customer
Item

The customer and the item are the keys - how do I select the latest record
(defined by date) for these two keys
 
T

Tom Ellison

Dear Bev:

First, the query must determine the most recent date for each Customer/Item.
A query to do this is:

SELECT Customer, Item, MAX(Date) AS MaxDate
FROM YourTable
GROUP BY Customer, Item
ORDER BY Customer, Item

This may, or may not be everything you want. It does not "select" the
record, but it gives you the values in it.

Please let me know if this helped, and if you need any further assistance.

Tom Ellison
 
Top