Case When ISNULL

Bone_12 361 Reputation points
2021-03-12T15:13:24.557+00:00

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 Other
0 comments No comments
{count} votes

Accepted answer
  1. Vaibhav Chaudhari 38,916 Reputation points Volunteer Moderator
    2021-03-12T15:17:23.397+00:00

    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

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.