total by month Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a commission table which lists the commission of employees biweekly.
So, there are two dates for each month in the table. I want to find the total
commisssion of each employee by month. Is there a way to do that using a
Query? I know it can be done by reports. I was wondering if it can be done by
query. I just need to transfer that infornation to Excel. So, I don't need a
report. Thanks for your help.
Purnima
 
Purnima,

It would help if you post your table structure.Do you just want the most
recent month, all months in the current year, all records, by year and month?
I'll assume the latter.

SELECT YEAR(Comm_Date),
MONTH(Comm_Date) as Comm_Month,
EmployeeID
SUM(Commission) as Monthly_Commission
FROM yourTable
GROUP BY YEAR(Comm_Date), MONTH(Comm_Date), EmployeeID

HTH
Dale
 
Back
Top