Query

  • Thread starter Thread starter Jan
  • Start date Start date
J

Jan

I'm trying to query a table that has employees and a
column showing 3 different levels of information (1, 2,
3). I want to bring back the employees that have more than
12 level 3's. I can bring back all the employees with
level 3 but I can't count the number of level 3 and only
bring back employees with > 12. Appreciate some help.
 
try this

SELECT TableName.Employee, TableName.Level, Count(TableName.Level) AS
CountofLevel
FROM TableName
GROUP BY TableName.Employee, TableName.Level
HAVING (((TableName.Level)=3) AND ((Count(TableName.Level))>12));

substitute the correct table name and field names, of course. i'm far from
an SQL whiz; i built the query in the QBE grid in design view, and only went
to the SQL view to copy it for pasting here - but i did test it with sample
data, and it ran correctly for me.

hth
 
Back
Top