I'm trying to write a "case" statement with the "in" clause and am getting compile errors.
So here's my code . . .
The errors I'm getting on compile . . .
So is the "in" clause not allowed with a "case" statement, or do I have some bad syntax?
Any help is appreciated.
Thanks!
Stay Cool Ya'll!![[smile2] [smile2] [smile2]](/data/assets/smilies/smile2.gif)
-- Kristin
So here's my code . . .
Code:
where . . .
IdCapPlusSrc in
case
when @Status = 4004 then
(select distinct IdCapPlusSrc
from CapPlus with (nolock)
where TmsSent is NULL)
else (select IdCapPlusSrc
from CapPlusSrc with (nolock)
where Status = @Status)
end
The errors I'm getting on compile . . .
Code:
Incorrect syntax near the keyword 'case'.
Incorrect syntax near the keyword 'else'.
So is the "in" clause not allowed with a "case" statement, or do I have some bad syntax?
Any help is appreciated.
Thanks!
Stay Cool Ya'll!
![[smile2] [smile2] [smile2]](/data/assets/smilies/smile2.gif)
-- Kristin