gpmfg 11/9/2020 7:41:23 PM

average of qty sold for last week and week before

I'm trying to report the average qtysold from table IV10201 by item number for:

the previous 7 days (or week)

the previous 30 days (or month)

show the difference of the last 30 days to the 30 days prior to that

show the difference of last 30 days to one year ago.

since there is more than one row per date and per item, I think I need to sum the qty sold based on a date parameter but I'm having a hard time determining the right way to write this. Any suggestions? 

Version: All
Section: Dynamics GP, SQL Scripts


Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3