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 |
|
yccyccycc
Starting Member
4 Posts |
Posted - 2009-07-08 : 14:07:55
|
| does anyone know how to set null data to "N/A"?I am a newbie and still learning. Thanks!!! |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-08 : 14:09:54
|
| ISNULL(yourfield,'N/A') or COALESCE(Yourfield,'N/A')your field should be of character type for doing this |
 |
|
|
yccyccycc
Starting Member
4 Posts |
Posted - 2009-07-08 : 14:30:10
|
| Thanks. how about if the origional datatype is numeric?To illustrate, I have a set of data which is numeric after all of the mathematic calculation. Some of the data are shown empty. I would like to fill out this empty spaces with "N/A"thank you! |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2009-07-08 : 14:32:40
|
That is a dispaly issue and should be handled in your front end application. However, if you insist you can still use COALESCE:SELECT COALESCE(CAST(NumVal AS VARCHR(38)), 'N/A') FROM My Table |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|