"Susan" <smiller (AT) worthington (DOT) org> wrote
Quote:
I have a table with the fields, OrderID,CustomerID,OrderDate,...........
There
are multiple orders for most customers in this table. I need help
constructing a
query that returns the earliest order for each customer and the OrderID of
that
order. |
Untested:
SELECT CustomerID, OrderID, OrderDate
FROM tblOrders AS a
WHERE OrderDate =
( SELECT min (OrderDate)
FROM tblOrders AS b
WHERE b.CustomerID = a.CustomerID )
But, understand that this could return *several* orders, each with the same
minimum date, for a single customer.
HTH,
TC