Hello. I am trying to order a selection by part number and only show the part number with the largest date (most recent transaction). My mind is about burnt at this point and any help would be appreciated.
` Select DISTINCT
Products.ProductCode,
Stock_History.New_Stock,
Stock_History.LastModified
FROM Stock_History LEFT JOIN Products ON Stock_History.ProductID = Products.ProductID
WHERE (Stock_History.LastModified >= "01/01/2012 00:00:00") AND (Stock_History.LastModified <= "01/31/2015 11:59:59") AND (Products.ProductCode <> "")
GROUP BY Products.ProductCode, Stock_History.New_Stock, Stock_History.LastModified
ORDER BY Products.ProductCode `
I attached a copy of the spreadsheet that is produced by the query. I need the unique product code and then the new stock quantity based on the latest lastmodified date. Thank you all in advance.