I have a status column that contains text.
I have to return either everything, or where the status is in(X) based on whether or not a flag was sent
is there a way to mix the case when and an IN statement?
-Sometimes the answer to your question is the hack that works
I have to return either everything, or where the status is in(X) based on whether or not a flag was sent
Code:
and (i.status = case when @ActiveOnly = 1 then 'OPEN' else i.status END
or
i.status = case when @ActiveOnly = 1 then 'PEND' else i.status END)
is there a way to mix the case when and an IN statement?
-Sometimes the answer to your question is the hack that works