View Full Version : count problem


arage
11-13-2001, 06:55 AM
count problem
I have a processedActivation table with text field that has a letter of the alphabet in it. I’d like to create 2 fields in my query, one that will tell me how many records contain “A” and another field that will tell me how many fields don’t contain “A”. What functions ought I be looking at since all my tests using a combination of COUNT( ), SUM ( ) and IIF ( ) in the criteria have been all for naught.

Pat Hartman
11-13-2001, 05:13 PM
Use the Sum() and IIf() functions.

Select Sum(IIf(YourField = "A",1,0)) As SumOfA, Sum(IIf(YourField = "A",0,1)) As SumOfNotA
From YourTable;