Concatenate fields, but not if null

R

Ricter

I would like to concatenate a series of fields, say Att1, Att2, Att3, and Att4.
I would like a comma and a space between each one.
If Att2, Att3, or Att4 is/are null, I do not want a comma and space added.
With the exception of Att1, any subsequent field may or may not be null.
What I'm after is: "Att1, Att2, Att4"
and not: "Att1, Att2, , Att4"

Is there an example of this kind of funcitonality somewhere that I can look
at, or can someone give me a code snippet that I could expand for more
attributes?

Thanks.
 
K

KARL DEWEY

[Att1] & IIF([Att2]Is Null,Null,", "&[Att2]) & IIF([Att3]Is Null,Null,",
"&[Att3]) & IIF([Att4]Is Null,Null,", "&[Att4])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top