Multiple counts in one query.

Henley12

Troy University Fan
Local time
Today, 01:42
Joined
Oct 10, 2007
Messages
222
Is there a way to count different fields in one query? For instance, I have a query that counts the number of pending work orders, but I also want to know how many of those pending are one day old, two days old, etc.
 
You probably need to use Sum(iif(criteria,1,0)

eg pending1day: sum(iif([pending]=1,1,0))
This purely for illustration

Brian
 
You probably need to use Sum(iif(criteria,1,0)

eg pending1day: sum(iif([pending]=1,1,0))
This purely for illustration

Brian

That's the way I would do it - Good Job Brian (as always)!!
 

Users who are viewing this thread

Back
Top Bottom