Skip to content
Advertisement

T-SQL query to summarize sales for ALL YEARS: with total per month per year, and cumulative monthly amounts

I need to create a Sales Report that shows all years sales per month, and cumulative sales. The database table is simple:

I want the results to look similar to ExcelSheet below (I am showing only 2017/2018 amounts, but actual query needs to return results for all available years according to TransactionDate)

enter image description here

Advertisement

Answer

Try it:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement