Need help my code does not output correcly... i need it 2 output the sum of the prices from the month befor. instead it output the summ from all months,, any help would be welcome
SELECT DISTINCT CarSales.Sales_ Staff_No, (SELECT SUM(CS.Purchase d_Price) FROM CarSales AS CS
WHERE CS.Sales_Staff_ No = CarSales.Sales_ Staff_No) AS Sales_for_last_ 6_month, CarSales.Date_O f_Purchase
FROM CarSales
WHERE (((CarSales.Dat e_Of_Purchase)> =#10/1/2006# And (CarSales.Date_ Of_Purchase)<=# 10/31/2006#));
SELECT DISTINCT CarSales.Sales_ Staff_No, (SELECT SUM(CS.Purchase d_Price) FROM CarSales AS CS
WHERE CS.Sales_Staff_ No = CarSales.Sales_ Staff_No) AS Sales_for_last_ 6_month, CarSales.Date_O f_Purchase
FROM CarSales
WHERE (((CarSales.Dat e_Of_Purchase)> =#10/1/2006# And (CarSales.Date_ Of_Purchase)<=# 10/31/2006#));
Comment