How do I count the number of occurences of a calculated sum in a .

G

Guest

Am attempting to count the number of individuals, in a group of many
individuals, where the sum of their hours for the month are >= or <= to an
aggreate without counting more than once. (i.e. sum of an individual is
between 10 and 20 hours don't want to count them if the if I use >= 10 with
those individuals with 21 hours.
 
G

Guest

I think these two queries will do what you want. You will need to add
criteria for the month in the first query.
EmpHours ---
SELECT Hours.ID, Sum(Hours.Hours) AS SumOfHours
FROM Hours
GROUP BY Hours.ID;

SELECT Count(EmpHours.ID) AS CountOfID
FROM EmpHours
WHERE (((EmpHours.SumOfHours) Not Between 10 And 20));
 

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