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 |
|
stango
Starting Member
8 Posts |
Posted - 2003-01-13 : 16:46:11
|
| Sql 6.5 (i know, I know, I need to update, but it's not my decision)I need to alias a null being returned from a query as such:Select Name,ID,CommentFrom UserWhere ID = 95This might give me the following:Name: 'Bob' ID: 95 Comment: NullI want the following:Name: 'Bob' ID: 95 Comment: 'No Data'Any Ideas?Thanks in advance |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-01-13 : 17:11:22
|
| Select Name,ID, IsNull(Comment, 'No Data') AS CommentFrom User Where ID = 95 |
 |
|
|
stango
Starting Member
8 Posts |
Posted - 2003-01-13 : 17:20:14
|
| Thanks. I tried Isnull. I kept getting an error, and erroneously I assumed that i couldnt use this function in 6.5, but it was an error because I was trying IsNull(some_int_field,'No Data') instead of IsNull(some_int_field,0) |
 |
|
|
|
|
|