The simple case function can only test equality, and as you cannot compare NULL with anything (Because it is unknown) It will never return true.
Use the searched case function instead:
WHEN someField IS NULL THEN 0
"Zig Mandel" <z_man_del[remove underscores and this]mac.com> wrote in message news:phx.gbl...
This appears to be a bug in sql server?
CREATE VIEW VNoNULL AS
SELECT CASE (someField) WHEN NULL THEN 0 ELSE someField FROM V
V is a View of two tables that have been LEFT JOINed:
CREATE VIEW V AS
SELECT R.someField from L LEFT JOIN R ON L.id = R.id
V.someField will sometimes be NULL (when there is no R with L.id = R.id) and
I want to make it look like a zero.
So I created VNoNULLs, but to my surprise, the <NULL> values were not
getting converted to zero.