Discussion Locked

Access 2000 summing Y/N fields

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Can anybody tell me how I can total the instances of YES in a Yes/No field. I have tried to create an unbound box in a report and typed in =SUM([FIELDNAME]) in the "properties>control source" but always end up with an error message.

Should I be doing this directly from a query instead?

Any pointers would be greatly appreciated.

IT Guru

3 replies

by churdoo

You are basically asking for a COUNT. You can use the query design tools to get a count of the field with the criteria set to "Yes", or in SQL, something like SELECT COUNT(*) FROM Mytable WHERE MyYesNoField='Yes';
If you ultimately want a decent-looking report, then build the query first and get the data the way you want it, then build the report based on the query.
Hope this is helpful. If not, you may contact me with more details and we can take it from there.
--Charlie

by adisha

Thanks for the advice on COUNT function. This pointed me in the right direction. However after much toil and trouble I managed to find a quick and easy way of achieving the best results and that was to use the wizard>summary>options. This saved an awful lot of time. I constructed the final report using the 'Save as' from the right click menu, once I had built my query.
Thanks again for your help.

This discussion is closed to new replies.