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 |
|
vedjha
Posting Yak Master
228 Posts |
Posted - 2008-07-21 : 11:03:41
|
| If data is null or '' Then Data show as Not Data:it works,select case vMobile when '' then 'No Data' else vMobile end as Mobile from membersbut I want also in other case when null. I write a code but not works:select case vMobile when '' or NULL then 'No Data' else vMobile end as Mobile from members:it gives errorsVed Prakash Jha |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-21 : 11:05:15
|
select case when vMobile = '' then 'No Data' WHEN vMobile IS NULL then 'No Data' else vMobile end as Mobilefrom members E 12°55'05.25"N 56°04'39.16" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-21 : 11:05:47
|
| SELECT COALESCE(NULLIF(vMobile,''),'No Data') as Mobile... |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-21 : 11:06:18
|
[code]SELECT CASE COALESCE(vMobile, '') WHEN '' THEN 'No Data' ELSE vMobile END AS MobileFROM Members[/code] E 12°55'05.25"N 56°04'39.16" |
 |
|
|
vedjha
Posting Yak Master
228 Posts |
Posted - 2008-07-21 : 11:09:51
|
| Thanks ViKash. its worksVed Prakash Jha |
 |
|
|
|
|
|