Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do you disregard a NULL when concatenating

Status
Not open for further replies.

plshelpme

Programmer
Nov 1, 2001
27
0
0
CA
I am trying to merge several columns into one in a view.
The problem is sometimes some of these columns contain a NULL value. So when I do; Col1 + ' ' + Col2 + ' ' + Col3
If any of these columns has a NULL value in it, the result is NULL, and not just the other two values concatenated toghether.

Any one see a way around this?

Thanks
 
I would do this by using Iif and Isnull functions in the concatenation and returning a zero length string if a null is detected. If your field is field1 do this:

Iif(Isnull(field1),"",field1)
 
i am getting the error message that ISNULL requires two arguments??
 
its just ISNULL(field1,'') ...thanks though ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top