View Single Post
  #3 (permalink)  
Old January 15th, 2004, 02:46 PM
jlick jlick is offline
Friend of Wrox
Join Date: Jun 2003
Location: Sparks, NV, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jlick

Similar to the last post, in MS-SQL server you can use the ISNULL() funciton.

Lets say the nullable field is Price, and you want null values to be 0. You could use something like the following:

SELECT ISNULL(Price, 0) 'Price', ...
FROM ...
This would return a field named Price. If the column value is not null, then it will return the value of the Price column. If the column value is null, then it would return 0.

You need the 'Price' to have it named, otherwise it would not keep the Price name.

John R Lick