I have a
datetime2 column called
DocDate that I am trying to evaluate an
ISNULL check against to return a blank
'' value for instead of
A snippet of the statement:
SELECT TOP 100 DocumentId ,DocDate ,ISNULL(DocDate,'') AS 'DocDateEmpty' FROM DocDetails WHERE DocDate IS NULL
WHERE clause clearly brings back only the rows that are explicitly
NULL, so it is not an issue of
DocDate being an empty string and evaluating to
DocDate IS NULL evaluate correctly but
ISNULL should evaluate the literal
NULL value correctly and return an empty value.
Returns the same type as check_expression. If a literal NULL is provided as check_expression, returns the datatype of the replacement_value. If a literal NULL is provided as check_expression and no replacement_value is provided, returns an int.