Hopefully simple query question

S

Steve

I'm sure there is a simple answer to this question but it
is currently eluding me. I have an employee table related
to an employee project file in 1:many relationship. Each
employee can have multiple projects assigned to him/her.
Each employee can have the same project assigned to
him/her on multiple occassions. I want a query to tell me
the total number of employees that have been assigned to
a particular project. The problem I am having is that
employees that have been assigned the project more than
once are counted each time they were assigned that
project. I just want an employee counted once if assigned
to that project, no matter how many times that project
was assigned to that employee. Hope this makes sense.
Thanks for your help.
 
J

Joe B

Try using "Select Distinct ......" Assuming you are only selecting the
ProjectID and the EmployeeID, this should work. If the employee is in there
several times with slightly different information (such as a time stamp)
then the records won't be distinct. Select the least amount of columns you
need. You should only need to select 2 fields (Employee, and Project) and do
a sum().

Hope that helps,
Joe
 

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