summarize data in access 2007

H

HelpMe!

I have a EmployeeInfo table with 1000 records. Each employee has an
autonumber EmployeeID field. Within that same table there are 117
supervisors, identified in the SupName field. I would like to summarize the
count of EmployeeID by SupName. I have no idea where to begin... Please let
me know if you need more info.
Thanks all!
 
J

Jerry Whittle

SELECT SupName, Count(EmployeeID)
FROM EmployeeInfo
GROUP BY SupName
ORDER BY SupName ;

Open a new query but don't add any tables. Go to View, SQL View and past in
the above.

As a side note: Assuming that the Supervisor is in the EmployeeInfo table as
an employee, you shouldn't have a name in the SupName field. Instead you
should have the EmployeeID of the supervisor there. Then you could do a self
join on the table. Why? Here's just one example: A Supervisor changes their
name, like getting married or something. With your setup you would need to
change the supervisor's name in their employee record AND for each employee
where they are the supervisor. If you did it by EmployeeID in the SupName (or
better yet SupID) field, you would only need to change it in one place.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top