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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Concatenating NULL

Author  Topic 

SqlFriend
Starting Member

26 Posts

Posted - 2004-08-26 : 05:49:35

I am using this SELECT statement:

SELECT vend_city + vend_state FROM Vendors

And it works correctly. However, if I have a NULL in vend_state, then when that combines with vend_city, the entire output becomes blank. I have tried CAST on vend_state- didn't help.

How can I get the vend_city to appear whether or not vend_state is NULL?

(This is SQL Server 2000)

Thanks for any ideas

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-08-26 : 05:55:50
this should do:

SELECT isnull(vend_city, '') + isnull(vend_state, '') FROM Vendors

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page
   

- Advertisement -