I am working on a query that works off of a table with these rows:
Date, Item_ID, Quantity
Sample data:
6/1/2014, 1, 30
6/2/2014, 1, 30
6/2/2014, 1, 30
6/3/2014, 2, 40
6/4/2014, 2, 40
6/6/2014, 2, 60
Now what I am trying to accomplish is make a query that sums each three day period (so 6/1/2014-6/3/2014 then 6/4/2013-6/6/2014).
Once that is done I only want to display whichever total is higher in the final column. In the case of the above data the Total column would have a value of 140 for Item_ID = 1. There are multiple Item_IDs in the table but for the purpose of this I need the query to work on each Item_ID separately.
Date, Item_ID, Quantity
Sample data:
6/1/2014, 1, 30
6/2/2014, 1, 30
6/2/2014, 1, 30
6/3/2014, 2, 40
6/4/2014, 2, 40
6/6/2014, 2, 60
Now what I am trying to accomplish is make a query that sums each three day period (so 6/1/2014-6/3/2014 then 6/4/2013-6/6/2014).
Once that is done I only want to display whichever total is higher in the final column. In the case of the above data the Total column would have a value of 140 for Item_ID = 1. There are multiple Item_IDs in the table but for the purpose of this I need the query to work on each Item_ID separately.