Select Last Sale Date
Posted on 2011-03-14
I have a SaleTable with upc, movement date, store, vendor and qnty as part of the record. I have InvTable with upc, store, and vendor as part of the record. I need to return the top n records (last n times the upc was sold by date) from the SaleTable for each record in the InvTable. The returned number of records needs to be for each upc, store, vendor. So if I want to return the top 2 reocrds from the SaleTable it would be the lastest two dates that the upc was sold for each store and vendor.