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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Queries and Radio Buttons!

Status
Not open for further replies.

metalboy

Technical User
Joined
Apr 1, 2004
Messages
97
Location
GB
Ok i am using forms which have radio buttons. now i want to create a query where it checks each record and counts the amount of positive radio buttons (the amount checked). I have tried and up to now it counts every one wether checked or not!!

any help??

Regards

Alex

 
queries don't count radio buttons on forms.

queries can count whether or not a field in a table matches a specific criteria.




Leslie
 
sorry i guess i did not express myself correctly. i have a field in a table which has a radio button so is either positive or negative. how do i count only the positive ones???

thanks
 
Do you mean "check box" ... not "radio button"? If so, that field is a "Yes/No" field and you can count the "Yes" values with code of the form
[blue][tt]
..., SUM( IIF ( FieldName, 1, 0 ) ) As [Yes Count], ...
[/tt][/blue]
 
where do i put this code? sorry i am very basic
 
It's part of the SQL.

SELECT FIELD1, SUM(IIF(FIELD2, 1, 0)) As [Yes Count], FIELD2 FROM TABLE

Leslie
 
also, please try to avoid double posting:

Thread702-815305

Leslie
 
Leslie

Thank you. Guess I should have put it in context as you did.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top