I have a simple question that has me stumped. I have a two column table, [EVENT_ID], [OUTCOME]. [OUTCOME] has "yes" or "no" values. Is it possible to count both the yes and no is one query? Thank you.
PHV,
You are usually so invincible. Surely you meant to use Sum(...) rather than Count(...).
SELECT Sum(IIf([OUTCOME]="yes",1,0)) As [Yes], Sum(IIf([OUTCOME]="no",1,0)) As [No]
FROM yourTable
or
SELECT Sum(Abs([OUTCOME]="yes")) As [Yes], Sum(Abs([OUTCOME]="no")) As [No]
FROM yourTable
Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.