David,
Generally, when I see this type of post, it is because the user wants to
display the most recent record for a particular store or individual or
something along those lines, and as Ken mentioned, how you deal with it can
be dependant on what functionality you want.
1. If you are not worried about the record being updateable (report or a
form where you are just displaying information, you could do something like:
SELECT T1.*
FROM yourTable as T1
INNER JOIN (SELECT StoreID,
MAX(SalesDate) as MostRecentSales
FROM yourTable
GROUP BY StoreID) as T2
ON T1.StoreID = T2.StoreID
AND T1.SalesDate = T2.MostRecentSales
If find that this type of query generally runs quicker than the following
query, but this is not updateable.
2. Another way to do this is:
SELECT T1.*
FROM tblSalesData as T1
WHERE T1.SalesDate = DMAX("SalesDate", "tblSalesData", "StoreID = " &
T1.StoreID)
This method is updateable, but will take longer to run agains a large
dataset because it has to evaluate the DMAX( ) domain function for each
record.