Link to home
Start Free TrialLog in
Avatar of SStroz
SStrozFlag for United States of America

asked on

Formula for concatenating multiple fields with "commas" to seperate values

Gurus,

I could use some help figuring out how to write a formula for this problem:

I have 6 separate currency fields to concatenate in one field.  I have to eliminate values of 0.  

I wrote a formula like this:
if isnull({field 1}) or {field 1} <= 0 then "" else Cstr({field 1}, 0, "") & "% Fiber"

I can't figure out how to include the commas (,) to separate more than one value or eliminate the comma if there's only one value.

The result would display something like this:
10% Fiber, 5% Protein

...or in cases where there's only one value:
10% Fiber


Can you help?

Thanks in advance!!

Steve
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 SStroz

ASKER

Thanks SO much mlmcc!  

I needed them to all be added together so I just added a "strOut"

strOut := strOut + ", " & Cstr({field 2}, 0, "") & "% Protein";

Thanks for pointing me in the right direction!!!

Steve
Avatar of SStroz

ASKER

Thanks mlmcc!!!
Avatar of Mike McCracken
Mike McCracken

Sorry, that should have been in the solution

mlmcc