SStroz
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks mlmcc!!!
Sorry, that should have been in the solution
mlmcc
mlmcc
ASKER
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