Date Field Null Comparison problem in Stored Procedure using CASE statement
Posted on 2006-05-15
I have the following statement in my stored procedure as a part of the select statement
CASE WHEN dbo.properties.RefAgreeRecd = NULL
DATEDIFF(d , dbo.properties.ReoAssignDate , GETDATE())
- 1 * DATEDIFF(d , dbo.properties.reoassigndate , dbo.properties.RefAgreeRecd)
The statment works fine for everything except null values. It returns null instead of returning the difference between today and REOAssignDate which has a date in it.