Your situation is made more complicated because you're storing multiple data
in the Month (note: Not good practice to use Month, Year, Date, Day, Time,
Name, etc. as the names of fields, because these are reserved words / names
of VBA functions in ACCESS, and you can greatly confuse ACCESS when you use
them, which at best can provide erroneous data and at worst make your query,
form, report, or database stop working correctly) field. Why not store the
year in one field and the month in a second field? Then you can very easily
do what you seek by finding the Maximum of both fields.
However, with your setup, something such as this query might do the trick:
SELECT Customer, Price FROM TableName
WHERE Val(Mid([Month], 6)) =
(SELECT Max(Val(Mid(T.[Month]))) FROM TableName AS T
WHERE T.Customer = TableName.Customer)
ORDER By Customer;
--
Ken Snell
<MS ACCESS MVP>
tjberrym said:
Please help me!! I need to restrict the data in my query to isolate
pricing to the most rescent month.