I'm trying to find the cost of ammunition by rounds. I need the last purchase only of certain types of ammunition. However, all of the purchases appear repeating the types of ammunition bought. For instance, I have CaliberID and CaliberTypeID (Primary Keys). If I have CaliberID=1 and CaliberTypeID=1, or CaliberID=1 and CaliberTypeID=2, I don't need the older purchases of those to come up with those same primary keys. I only need the last purchase with those primary keys. With the query I wrote, all of the purchases show up. I'm not sure what I'm doing wrong.