Reputation: 992
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
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