Query to Count If >=

  • Thread starter Thread starter carl
  • Start date Start date
C

carl

My data is like this...

Item Units
AAA 25
AAA 3
BBB 2
CCC 20
DDD 10
DDD 100
DDD 100

I trying to find a query that will look at the Item and count the number of
times the Units is greater or equal to 20.

The result of the query would be like this...

Item CountUnits>=20
AAA 1
CCC 1
DDD 2

Thank you in advance.
 
The WHERE clause is executed before the aggregates, so, in SQL view:



SELECT item, COUNT(*)
FROM tableName
WHERE units>=20
GROUP BY item



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top