Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2003
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Totaling Yes/No Data Type Field (2000)

    Can someone please tell me how I can total the number of "true" values in a yes/no data type field of a report? The report lists the individual records and reflects the yes/no boxes and whether or not they are checked (or true). But we would like to see a total of the true values at the end of the report. Would appreciate any help you can offer. Many thanks...Mary

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Totaling Yes/No Data Type Field (2000)

    Put a text box in the report footer and set its control source to

    =Abs(Sum([FieldName]))

    Substitute the name of your field for FieldName. Explanation: in Access, True = -1 and False = 0, so if you sum a Yes/No field, the result is -(number of True values). By taking the absolute value, you get the number of True values.

    Note: in SQLServer, True = 1; if you ever migrate the table to SQLServer, the above expression will still work.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2003
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Totaling Yes/No Data Type Field (2000)

    Brilliant! Thank you so much! I did just what you advised and it works beautifully! I appreciate what you did in helping me with a solution so quickly.....Many, many thanks!...Mary

Posting Permissions

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