# Thread: Report Counting (97 SR2)

1. ## Report Counting (97 SR2)

I've got a field in my report that contains checkboxes. For some reason, the following formula will not count only the checked boxes in the report, it's returning #error:

=DCount("*","Person","[Person_Here]='-1'")

Shouldn't this work?

2. ## Re: Report Counting (97 SR2)

I always cheat when little things like this happen. In the query that the report runs from create a new column that puts a value of 1 in when the checkbox value is yes and 0 when no. Then a simple count on your report will work for the new field. Or even easier sum the new field.

Field: iif([field1] = -1,1,0)

Though thinking about it have you tried taking the ' and " marks away from the "[Person_Here]='-1'") to read

=DCount("*","Person", [Person_Here] = -1)
or
=DCount("*","Person","[Person_Here] = -1")

3. ## Re: Report Counting (97 SR2)

I always use a similar approach.
Multiply the value by -1without the IIF statement.

In the query:
new_field: [old_field] * -1

Same place...different route.
<img src=/S/wink.gif border=0 alt=wink width=15 height=15>

4. ## Re: Report Counting (97 SR2)

Just sum the field over the report, Drk. Checkboxes are going to be -1 or zero under the hood (unless they're null, but we don't want to go there), so summing the field will return the count and you can use the Abs() function to make it a positive number.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•