Access query - Get the last of each item by date
Posted on 2014-01-25
In a query, I need to pull all of the last records of every itemID that is ActiveYN = Yes.
So if my table [t_Dtail] is
DetailID, tdate, ItemID, ActiveYN
how do I do that?
If I do it as
SELECT * From t_dtail WHERE ActiveYN = True
I know I get everything that's true.
So if my table has 50 ItemID # 20 How do I get just the Last True of all the ItemID (not just number 20's??????
SELECT * From t_dtail WHERE ActiveYN = True HAVING ItemID= DMax(ItemID, t_Dtail,ItemID)
But that doesn't get it either