As a newbie in SQL I am trying to do a comparison of sales data with in one file. There is one record per sale so I have to sum up all the sales per customer for the time period. I want to show a customers sales for the current year/month compared to the previous year/month but all the data is in the same table.
I want to show for example Customer Name, 1/2016 Units Sales, 1/2016 Sales $$$, 1/2016 GP $$$, 1/2015 Unit Sales, 1/2015 Sales $$$, 1/2015 GP $$$.
I am thinking go thru my customer table and calling a stored procedure that has parameters of customer number and dates to calculate sales from.. Am I on the right track or over thinking it?