I have a table with a history of the costs and a dates for each item. I want the most recent cost for each item.
When I do a query and select the Max of date in the "Total" row, I get the most recent date for each cost. This means I have a new line each time the cost changed over the whole history.
I think it may be possible to use a subquery in the "Criteria" row, but I haven't been able to figure out how.
Here is the SQL I have now:
SELECT [Material Cost Table 1].SOURCE, [Material Cost Table 1].ITEM_NO, [Material Cost Table 1].COST, Max([Material Cost Table 1].DATE) AS MaxOfDATE
FROM [Material Cost Table 1]
GROUP BY [Material Cost Table 1].SOURCE, [Material Cost Table 1].ITEM_NO, [Material Cost Table 1].COST;
Thank you,