Hi All
I am trying to limit the out put of my query to last 3 months only, tried using the below which i ve modified from showig 12 months, but it still seems to show 3 all 12 months, can anyone help with how i can limit to showing 3 months only
SELECT DISTINCTROW [Actual Sales]*(100/(100+(100*[Growth]))) AS [ActualSales-1], SalesReportTerritory.Month, SalesReportTerritory.[Actual Sales], SalesReportTerritory.[Sales Target], SalesReportTerritory.[Target Percentage], SalesReportTerritory.Growth, SalesReportTerritory.Territory
FROM SalesReportTerritory
WHERE (((SalesReportTerritory.Month)>=DateSerial(Year(Date())-1,Month(Date())+1,0)))
GROUP BY [Actual Sales]*(100/(100+(100*[Growth]))), SalesReportTerritory.Month, SalesReportTerritory.[Actual Sales], SalesReportTerritory.[Sales Target], SalesReportTerritory.[Target Percentage], SalesReportTerritory.Growth, SalesReportTerritory.Territory, Year(SalesReportTerritory.Month)*3+DatePart('m',SalesReportTerritory.Month)-1
ORDER BY SalesReportTerritory.Month;
Thanks
Ali
I am trying to limit the out put of my query to last 3 months only, tried using the below which i ve modified from showig 12 months, but it still seems to show 3 all 12 months, can anyone help with how i can limit to showing 3 months only
SELECT DISTINCTROW [Actual Sales]*(100/(100+(100*[Growth]))) AS [ActualSales-1], SalesReportTerritory.Month, SalesReportTerritory.[Actual Sales], SalesReportTerritory.[Sales Target], SalesReportTerritory.[Target Percentage], SalesReportTerritory.Growth, SalesReportTerritory.Territory
FROM SalesReportTerritory
WHERE (((SalesReportTerritory.Month)>=DateSerial(Year(Date())-1,Month(Date())+1,0)))
GROUP BY [Actual Sales]*(100/(100+(100*[Growth]))), SalesReportTerritory.Month, SalesReportTerritory.[Actual Sales], SalesReportTerritory.[Sales Target], SalesReportTerritory.[Target Percentage], SalesReportTerritory.Growth, SalesReportTerritory.Territory, Year(SalesReportTerritory.Month)*3+DatePart('m',SalesReportTerritory.Month)-1
ORDER BY SalesReportTerritory.Month;
Thanks
Ali