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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenate two fields where one is null

Status
Not open for further replies.

Cloonalt

Programmer
Jan 4, 2003
354
US
I use the following, but if only one of the fields that I'm concatenating is null, Comments returns as null. Both fields are string.


Select mmatter, mdesc2 + ' ' + mdesc3 as Comments from matter

Can't seem to find the syntax. Any help is appreciated.
 
you can't expect a null value to give you a blank string, because null does not mean blank, it means no value. blank is a value.

do this:

Code:
Select mmatter, isnull( mdesc2, '' ) + ' ' + isnull( mdesc3, '' ) as Comments from matter



*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top