Count Boolean Values

Posted on 2011-05-09
Last Modified: 2013-11-28
Good afternoon!

I have a table that contains the following (Note; only one table no links to other tables)
I need to count the number of records that have the field NoValidAddress = Yes
(boolean, yes if not valid address, no if a valid address).  No matter what I try, I count all of the records in the table - any help would be great appreciated!

Thanks very much,
Colleen Slater Table View Table View
Question by:rporter45
    LVL 100

    Accepted Solution

    Try this

    Add a formula to the report
    If {BooleanField} then

    Put it in the details section
    Right click it
    Choose type as SUM
    Put it in the appropriate footer

    You can delete the formula from the details section


    Author Comment

    Fantastic!  It worked perfectly - If you do have a moment, can you please explain the logic?  From my limited perspective on Crystal, the field values were already 1 and 0 but we declare the same again.  

    Thanks very much!  

    LVL 100

    Expert Comment

    As far as Crystal is concerned the values are TRUE and FALSE which arent numeric.  The IF provides the values 1 and 0 so the sum can be done.

    If you need to count the false values
    If  NOT {BooleanField} then


    Author Comment

    Sounds extremely sensible now that you have explained!  Thank you for this,


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now