select 'ABC' + Null = Null ?

  • Thread starter Thread starter Jerry Qu
  • Start date Start date
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
 
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.
 
Back
Top