Aravind30790
Aravind30790

Reputation: 992

How to perform IS NOT NULL inside CASE WHEN

How can i get values that are not null from C.Carrier when the variable @status = 'Completed' , something like this

   WHERE CASE WHEN @Status = 'Completed' THEN C.Carrier IS NOT NULL END

Upvotes: 0

Views: 96

Answers (1)

Barmar
Barmar

Reputation: 780724

I don't think you need CASE, just AND:

WHERE @Status = 'Completed' AND C.Carrier IS NOT NULL

If this isn't right, then it would probably help to see more of your query to understand the context.

Upvotes: 4

Related Questions