Query to Count If >=

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.
 
M

Michel Walsh

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
 

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