I have a table that stores a physical inventory count. I am struggling to write a query that will sum the quantity of just the records with the most recent date. For example:
If this is the input, Product, Date, and Qty.
product1 6/1/2015 1
product1 6/1/2015 1
product1 5/1/2015 1
I want a query to sum the qty of only the MaxDate, so in the example I gave, the total Qty would be 2.
Currently I can output the max date just fine, but when I sum the Qty I keep getting 3 as my output.
Thanks