General information
Forum:
Microsoft SQL Server
Title:
Case with multiple then
I have a case:
set @result =
case
when (@state = 'CA' or @state = 'WA' or @state = 'OR') and @plinid = 'PERDOM' then 0 "--set @reson = 'PERDOM product line not allowed in CA,WA, OR'"
when (@state = 'NY') and (@comcode = 'KR') and (@plinid <> 'DJAR' or @plinid <> 'DREAMS') and (@item not like '%LIP_%') then 0
else 1
end
I want to be able to set @result to 0 or 1, which works fine, but I also want to set another variable, for example
when this then 1 and 2
Not sure if I can do this. Any help would be appreciated, thanks!!!
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only