Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Star Lounger
    Join Date
    Feb 2001
    Location
    Wirral, Merseyside, Merseyside, England
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    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.
    Charlotte

Posting Permissions

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