I have this code in my select statement
ISNULL(a.PolicySignedDateTime,aq.Amount) AS \'Signed Premium\',
But I want to see if \"a.PolicySign
There is no opposite function but you can do it without CASE
.
Use the fact that a string + 'something' will be NULL if string is NULL, and if that is null then use ISNULL to return 'somethingelse', get end of the returned value with RIGHT() and check that against 'something' using NULLIF, and then use COALESCE to do what you'd like to do if that is NULL (meaning original value is not null).
Example:
declare @text varchar(20) = 'some text or value'
select COALESCE(NULLIF(RIGHT(ISNULL(@text + 'NOT', 'IS ') + 'NULL', 7), 'NOTNULL'), 'NOT NULL')
Try this code and also try it with no value for @text.