twice300
Technical User
- Jan 31, 2007
- 19
I have developed a small app that keeps track of employee information. One table is Sacntions. I keep track of disciplinary measures given out to employees.
At the end of the month, I need to give out a grade per employee based on the amount of sanctions given, if any.
I have wrote this query, but I can't get it to work:
When I try to save the query I get the following error: "Syntax error (missing operator) in query expression 'sum...."
Is this not allowed in Access. I know this will run in MS SQL.
Thanks in advance for your input.
George Adams
At the end of the month, I need to give out a grade per employee based on the amount of sanctions given, if any.
I have wrote this query, but I can't get it to work:
Code:
SELECT tblSanctions.SanEmployeeId,
sum(case when SanCategory = "Verbal" then -5
when SanCategory = "Written" then -15
when SanCategory = "1 Day Suspension" then -40
when SanCategory = "3 Day Suspension" then -60
when SanCategory = "5 Day Suspension" then -80
when SanCategory = "8 Day Suspension" then -100
else then 0 end) as [TempSanctionGrade]
FROM tblSanctions
GROUP BY tblSanctions.SanEmployeeId
Where (((tblSanctions.SanctionDate)>=#8/1/2007# And (tblSanctions.SanctionDate)<=#8/31/2007#));
Is this not allowed in Access. I know this will run in MS SQL.
Thanks in advance for your input.
George Adams