• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 643
  • Last Modified:

Concat fields separated by commas

I have a database with several fields I need to combine, separated by commas. The problem is some of these fields will be null and I don't want to run into the issue where I see the following:

data1, data2, , ,

I want it to display as:
data1, data2

in addition if data1 is empty, I want to suppress the entire field.

Anyone able to tell me how to do this?
0
DarkHound
Asked:
DarkHound
  • 2
1 Solution
 
peter57rCommented:
You would have a formula field like....

stringvar mlist;
if isnull({table.data1}) then
mlist:=""
else
mlist:={table.data1};

if mlist="" then
//do nothing
(mlist:=mlist
)
else
(if isnull({table.data2}) then mlist:=mlist else  mlist:=mlist & "," & {Table.Data2};
if isnull({table.data3}) then mlist:=mlist else  mlist:=mlist & "," & {Table.Data3};
if isnull({table.data4}) then mlist:=mlist else  mlist:=mlist & "," & {Table.Data4}
);
mlist






0
 
DarkHoundAuthor Commented:
hmm I don't see a formula field option
0
 
DarkHoundAuthor Commented:
Nevermind, I figured it out. Thanks!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now