I am using SQL Server 2008R2 I have a very simple table with 4 columns
Date, Product, Customer, Sales
I need to accomplish 2 things, A running total by Product & Customer (I have figured this out), but there are gaps in my dates. Somehow, I need to create rows for these reflecting $0 for Sales, so that the ending result has a continuous running total.
Here is what the Data Looks Like, below is what I need to get to. Thank you in Advance for any help.
Date Product Customer Sales 1/1/2014 101 A 10 1/4/2014 101 A 50 1/6/2014 101 A 20 1/2/2014 102 A 5 1/3/2014 102 A 5 1/2/2014 101 B 15 1/5/2014 101 B 10
What I need:
Date Product Customer Sales Cum Sales 1/1/2014 101 A 10 10 1/2/2014 101 A 10 1/3/2014 101 A 10 1/4/2014 101 A 50 60 1/5/2014 101 A 60 1/6/2014 101 A 20 1/2/2014 102 A 5 5 1/3/2014 102 A 5 10 1/2/2014 101 B 15 15 1/3/2014 101 B 15 1/4/2014 101 B 15 1/5/2014 101 B 10 25