Display sum of boolean field with positive numbers

Is there a way to display the sum of a boolean field with positive numbers? The expression belows provides me with the correct sum totals for the "married" field except that they are always displayed with a minus sign preceding the answer.

[SUM(<frxDBDataset1."Married">,MasterData1,1)]

Thanks for any help,
Brent ;)

Comments

  • edited 2:49AM
    If you want to do the conditional summing, use the scripts and calculate the sum yourself.
  • edited 2:49AM
    So in other words, I've lost some functionality by upgrading to FR3.x.
    In version 2.5x the code I used below provided me with exacly what I needed. I cannot do that with version 3.x. In fact the code generator in 2.5x wrote most of the code.

    [SUM([AdsQuery1."Married"]=TRUE)]
    _____________________________________

    Could you post an example script? I believe that would be more helpful than just saying you need to write scripts.

    Thanks,
    Brent ;)
  • edited 2:49AM
    If you try to convert True to integer, you'll get -1. FR does the same. Just do:
    [ABS(<SUM(<frxDBDataset1."Married">,MasterData1,1)>)]
  • edited 2:49AM
    Thank you very much! That did the trick. By the way, what is "ABS"?

    Brent
  • gordkgordk St.Catherines On. Canada.
    edited 2:49AM
    same as in delphi function to return absolute value no signs.
    ;)

Leave a Comment