Simply Count Query... why so difficult?

The_Vincester

Registered User.
Local time
Today, 00:49
Joined
Jun 6, 2006
Messages
71
I have Two fields with DateWorked and EmployeeNumber. All I want to do is count the number of employees that worked on a specific date. In the employee numbers I have 4 dummy numbers that I don't want to count in my query (00001-00004), but will have entries almost each day. The rest are 5 digit numbers.

Some employee will work some days, but not others.

So I set up my query with:

EmployeeNumber
Table
Total: Count
Criteria: >4

I did that think that it would count all employee numbers great than four, but all it seems to do is give me the count of days that more than 4 employees worked.

What am I doing wrong? I feel like this is simple, but after some of the more complex things I've done over the past week, this seemingly "easy" thing has me stumped.
 
Try:
Code:
SELECT DateWorked, COUNT(EmployeeNumber) AS [# of Employees]
FROM [b]MyTable[/b]
WHERE EmployeeNumber>'00004'
(substitute MyTable with the actual table name)
 
This works for the count, but then it doesn't add in the totals I've put in for the "dummy" employees. I'm calculating a "leftover" amount, that needs to be added to the other totals. All entries must have an employee number.
 
The_Vincester said:
This works for the count, but then it doesn't add in the totals I've put in for the "dummy" employees. I'm calculating a "leftover" amount, that needs to be added to the other totals. All entries must have an employee number.

This statement seems to be totally at odds with what was first asked, I think that you need to explain your requirements more fully.
 

Users who are viewing this thread

Back
Top Bottom