By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,313 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

Help with adding sales by Month

P: 14
Dont no 2 much about SQL any help welcome.
OK, need 2 creat an SQL for the total cost of the cars sold by each salesman in the past month . i.e SalesMan 1. Sold amount

I have this so far

SELECT DISTINCT CarSales.Sales_Staff_No, (SELECT SUM(CS.Purchased_Price) FROM CarSales AS CS
WHERE CS.Sales_Staff_No = CarSales.Sales_Staff_No) AS Sales_for_last_6_month, CarSales.Date_Of_Purchase
FROM CarSales
WHERE (((CarSales.Date_Of_Purchase)>=#10/1/2006# And (CarSales.Date_Of_Purchase)<=#10/31/2006#));



This is my out put.

Sales_Staff_No Sales_Last_month Date_Of_Purchase
1 32,085.00 03/10/2006
3 42,425.00 04/10/2006
3 42,425.00 09/10/2006
4 42,484.00 22/10/2006
5 274,978.00 12/10/2006



All i need is for it 2 display the sales man name, an the amout he/she sold last month... any sudgestion
Nov 29 '06 #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,615
Perhaps if you included where the name is stored...?
It seems you already have the amount showing though :s
Nov 30 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.