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 |
|
ZMike
Posting Yak Master
110 Posts |
Posted - 2008-11-18 : 08:58:36
|
| I wanted Null fields to show as blank. In another view I had made a query for certain services that I'm joining to a new query. In the final version I want any Null fields to show as ' ' (CASE WHEN [Services].[Service] IS NULL THEN ' ' ELSE [Services].[Service] END) AS [Service] |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-18 : 09:00:26
|
| just use COALESCE([Services].[Service] ,'') |
 |
|
|
ZMike
Posting Yak Master
110 Posts |
Posted - 2008-11-18 : 09:01:23
|
| Nevermind it worked. I didnt see my extra field on the end of my select list... Sorry about that. |
 |
|
|
ZMike
Posting Yak Master
110 Posts |
Posted - 2008-11-18 : 09:03:02
|
| visakh16, I'll have to check that out I was looking around on the forums and read some post about COALESCE.Thanks ! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-18 : 09:08:41
|
quote: Originally posted by ZMike visakh16, I'll have to check that out I was looking around on the forums and read some post about COALESCE.Thanks !
Welcome |
 |
|
|
asgast
Posting Yak Master
149 Posts |
Posted - 2008-11-18 : 11:17:05
|
| use isnull([Services].[Service], '') as [Service] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-18 : 12:33:35
|
quote: Originally posted by asgast use isnull([Services].[Service], '') as [Service]
both are fine. But in some cases coalesce is found better because of following reasonhttp://sqlblogcasts.com/blogs/madhivanan/archive/2007/10/04/isnull-or-coalesce.aspx |
 |
|
|
|
|
|