question

Bone12-2270 avatar image
0 Votes"
Bone12-2270 asked ·

Case When ISNULL

Hi,

I have the following Case statement, but my logic doesn't seem to work, any idea why this is please?


case when method = 'TP' and second_method ISNULL then 'New' end as Method_Type


This is my error message:
An expression of non-boolean type specified in a context where a condition is expected, near 'ISNULL'.

sql-server-general
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

VaibhavChaudhari avatar image
0 Votes"
VaibhavChaudhari answered ·

Provide a space in between "IS NULL"

try:

 case when method = 'TP' and second_method IS NULL then 'New' end as Method_Type


Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.