I tried this:
declare @date as datetime
SET @date = '1/1/1901 12:00:00 AM'
SELECT @date, CONVERT(numeric(9,3), @date) as DateValue
if (isnull(@date,0) = 0) SELECT 'date is zero' ELSE SELECT 'date not equal to zero (THIS PRINTS)'
if (isnull(@date,0) = 365) SELECT 'date is 365 (THIS PRINTS)' ELSE SELECT 'date not equal to zero'
if (@date = 365) SELECT 'date is 365 (THIS PRINTS)' ELSE SELECT 'date not 365'
SET @date = '1/1/1900 12:00:00 AM'
SELECT @date, CONVERT(numeric(9,3), @date) as DateValue
if (isnull(@date,0) = 0) SELECT 'date is equal to Zero (THIS PRINTS)' ELSE SELECT 'date not null'
if (@date = 0) SELECT 'date is equal to Zero (THIS PRINTS)' ELSE SELECT 'date not null'
There is nothing wrong with ISNULL nor with COALESCE.
The problem is that you are comparing with zero, and you fool yourself into thinking that the ISNULL kicked in.
Try my code, and see that ISNULL returns the correct value.