I haven't been able to find exactly what I am looking for in older forum posts (at least not anything that I can get to work), so I figured I would see if anyone can help me out.
I have 2 pretty simple tables. the first is a "customers" table that just has info related to customers: CustomerID_PK, CustomerName, etc
the second table holds a list of order dates (and other info, but for this question, I am only concerned with dates): OrderID_PK, CustomerID_FK (related to PK on "customers" table), OrderDate, etc. each customer has multiple orders, and this table really only holds a list of dates.
What I need to do is build a query that returns the customerID_PK and CustomerName (from "customers" table) and the MOST RECENT order date for EACH CUSTOMER. in other words, I need the most recent order date for CUST001, the most recent order date for CUST002... and so on. no other dates, just the most recent date for EACH customer.
so far, in query design view, I have
CustomerID_PK (sorted in ascending order)
CustomerName
OrderDate (sorted in descending order)
and I need to put a sub-query somewhere that would look at either the customerID_PK field or the OrderDate field and eliminate all the the first (most recent date)
not much experience with SQL or sub-queries, so any help is greatly appreciated.
Thanks in advance