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

How to Sum CheckBox in Query as a Positive #

Status
Not open for further replies.

mopester

Technical User
Dec 13, 2003
4
US
This is prob so easy, that I couldn't find the answer. I need a Query to search specific checkbox fields and give me the total selected. When I use the Sum in the Query design, I get the results as a negative number. How do I change it to a positive #?
 
Use Abs([CheckBoxField])

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Abs() converts all numbers to positive. To count the number of checked boxes, use:
=Sum(Abs([CheckBoxField]))
In any Group or Report Footer or Header section.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
I'm sorry, I thought I had a little understanding of how to do this, but obviously I don't. I've spent an hour trying to get this to work. I thank you for your help. If you want to spell this out for me, I'd appreciate it. If not, I understand.
 
If your Yes/No field name is FieldA and you want your query to count the number of Yes values then create a calculated column in you query:
Field: FieldAYes: Abs(FieldA)
Total: Sum

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top