Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count function on a Yes/No field...not working

Status
Not open for further replies.

lazariel

Technical User
Aug 1, 2002
4
US
Am trying to get the Count function to work on a "Yes/No" field. When I query a "count" on either the yes or the no, I get a nonsensical number or a total of both...would apprecitate the how on getting just the yes or no.

thanks
Chris
 
I am sure there are a number of ways, try this.

Select
sum(iif(yesnofield=-1,1,0)) as aYes, sum(iif(yesnofield=-1,0,1)) as aNo
From yourtable
 
Try this in an unbound textbox
=Sum(IIf(Yes/NoField = -1,1,0))

That should give you a count of yes'

Paul
 
Select Count([YN]) Where [YN] = True;

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top