Link to home
Start Free TrialLog in
Avatar of Beth S
Beth S

asked on

sum String field values of 0 and 1 in Crystal Reports

I have four fields that are all 144 char in length and data type is String.  The value is either 0 or 1 with no separating characters or spaces, and I want to sum the string.  Data example is:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111

Thank you in advance for your assistance!

BethS
Avatar of lcohan
lcohan
Flag of Canada image

Not sure what do you mean by "sum the string" - put them all together side by side or perform a actual SUM function on the values?
If you just want to concatenate all data you can add a new filed that contains the value from all these 4 fields combined together.
Avatar of Beth S
Beth S

ASKER

To clarify, I want to sum all the "1" values.  For example, the value I would like to be calculated from my data example above would be "54" as there are fifty four instances of the number 1.
What reporting tool are you using?

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Beth S

ASKER

Method 2 did the job! Thank you so much for answering my question and helping me learn! :)