How to report a count of a certain value in a field v. the sum of that field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sueb
    Contributor
    • Apr 2010
    • 379

    How to report a count of a certain value in a field v. the sum of that field

    I'm trying to write a report that counts the number of times a certain field is set to True (or Yes), but all I can get is simply the count of how many records fall in that particular group. Here is the syntax for the field's Control Source that doesn't do what I want:

    Code:
    =Count([Family]=True)
    What's the right way to say this? (I have several fields for which I want similar counts at the summary level.)
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You're trying to track how often a field was changed? You need to create a log and then insert into that log whenever the event you want to track occurs. Access doesn't have a log of record changes.

    Comment

    • sueb
      Contributor
      • Apr 2010
      • 379

      #3
      No, I'm trying to, in the summary line, count how many of the preceding group had a certain field set to a certain value, in this case, to "True".

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        So you mean a =Sum(IIf([Family]=True, 1, 0))

        Comment

        • sueb
          Contributor
          • Apr 2010
          • 379

          #5
          Apparently, that is exactly that I mean! Thanks so much!

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            No problem, good luck.

            Comment

            Working...