Query Question

S

Shirley Zaknich

I am trying to COUNT direct hours in Access - but I do not want to count the Zeros ( 0 ). I have tried a few scenarios but to no avail. I have also tried a BETWEEN criteria. But I really want to say, "don't count if it's a zero". Thanks to all who reply.
 
M

Michel Walsh

Hi,

The WHERE clause is applied BEFORE any aggregation. So,


SELECT COUNT(*)
FROM somewhere
WHERE fieldName <> 0
GROUP BY whatever


would indeed remove the records with a value of zero before making the
count.


Hoping it may help,
Vanderghast, Access MVP


Shirley Zaknich said:
I am trying to COUNT direct hours in Access - but I do not want to count
the Zeros ( 0 ). I have tried a few scenarios but to no avail. I have also
tried a BETWEEN criteria. But I really want to say, "don't count if it's a
zero". Thanks to all who reply.
 

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