Report expert help needed | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Report expert help needed

Hi guys, i need to generate the 3 columns the below report salesperson sales for current mth cummulated sales for curent and past month can someone help
Thanks AKTHAR
SELECT sp.SalesPerson,
(SELECT SUM(s.Sales) FROM sales s WHERE s.SalesPerson = sp.SalesPerson AND s.Date BETWEEN ‘2006-08-01’ AND ‘2006-08-31’)
PreviousMonthSales,
(SELECT SUM(s.Sales) FROM sales s WHERE s.SalesPerson = sp.SalesPerson AND s.Date BETWEEN ‘2006-09-01’ AND ‘2006-09-30’)
CurrentMonthSales
FROM SalesPerson sp
]]>

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |