Query Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 
Back
Top