I have the following query which will show the sales per week per representative.
But now I get the sales which is made in each week. But I want to cumulate this per week.
Example: Representative 1 has 100,- sales in week 1 and 200,- in week 2.
So I want to show 300,- in week 2 and so on (instead of 200,- in week 2).
Is this possible ?
datepart(WEEK, invoicedate)as week,
SUM(Amount-VAT) as sales,
left outer join customer on invoices.Debnr = customer.cust_id
where Datepart(year, invoicedate) = '2016'
order by week