Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
satheesh
Posting Yak Master
152 Posts |
Posted - 2012-02-24 : 10:34:29
|
Dear All,I try to replace Null or blank field in the result by adding 'NOT AVAIL'as default in query ie.ISNULL(PolicyHolder.AddressLineTwo,'NOT AVAIL')as Address2In the output few of them will get replace with 'NOT AVAIL' but still the output contains blank field.How to replace with default value 'NOT AVAIL'if the feild has no value or null or blank.Any help will be highly appreciated.ThanksSG |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-02-24 : 10:35:44
|
[code]ISNULL(NULLIF(PolicyHolder.AddressLineTwo,''),'NOT AVAIL')as Address2[/code] |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-02-24 : 10:46:13
|
quote: Originally posted by satheesh Dear All,I try to replace Null or blank field in the result by adding 'NOT AVAIL'as default in query ie.ISNULL(PolicyHolder.AddressLineTwo,'NOT AVAIL')as Address2In the output few of them will get replace with 'NOT AVAIL' but still the output contains blank field.How to replace with default value 'NOT AVAIL'if the feild has no value or null or blank.Any help will be highly appreciated.ThanksSG
the reason is NULL and blank are not the same'' means blank value where NULL means unknown value its not stored as a value in table field but rather its stored as a bit internally to indicate that value is unknown------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
X002548
Not Just a Number
15586 Posts |
|
satheesh
Posting Yak Master
152 Posts |
Posted - 2012-02-24 : 11:14:01
|
Many Thank you to all. |
|
|
|
|
|