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
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,814 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vaibhav Chaudhari 38,631 Reputation points
    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