select 'ABC' + Null = Null ?

J

Jerry Qu

Hi all,

please help me out here:

(adp + MSDE)

I have a very simple view:

select tableA.fieldA + ': ' + tableB.fieldB
from tableA Inner Join tableB On ...

When tableB.fieldB is Null, instead get "tableA.fieldA: ", I get nothing
even tableA,fieldA is not Null

I tested Select 'ABC' + ': ' + '' will get "ABC:"

but select 'ABC' + ': ' + NULL will get nothing

how to work arround this if I need to get "ABC:" if the 2nd part is Null

TIA

Jerry
 
S

Steve Jorgensen

Hi all,

please help me out here:

(adp + MSDE)

I have a very simple view:

select tableA.fieldA + ': ' + tableB.fieldB
from tableA Inner Join tableB On ...

When tableB.fieldB is Null, instead get "tableA.fieldA: ", I get nothing
even tableA,fieldA is not Null

I tested Select 'ABC' + ': ' + '' will get "ABC:"

but select 'ABC' + ': ' + NULL will get nothing

how to work arround this if I need to get "ABC:" if the 2nd part is Null

TIA

Jerry

See the ISNULL and COALESCE functions for MS SQL Server.
 

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