dianemarie
Instructor
Hello,
In English, I need to say this in my Where statement:
If @Division = M then oh.division in ('Management','In-House')
If @Division = B then oh.division in ('Brokerage','In-House')
else oh.listdiv <> 'C' (@Division = A)
I've been trying it using Case, and also Boolean. I'm having no success getting it to work. Any help would be appreciated. This was my last try:
where
(case @Division
when 'M' then
case oh.division
when 'Management' then 1
when 'In-House' then 1
else 0
end
when 'B' then
case oh.division
when 'Brokerage' then 1
when 'In-House' then 1
else 0
end
when 'A' then
case oh.listdiv
when 'c' then 0
else 1
end) = 1
In English, I need to say this in my Where statement:
If @Division = M then oh.division in ('Management','In-House')
If @Division = B then oh.division in ('Brokerage','In-House')
else oh.listdiv <> 'C' (@Division = A)
I've been trying it using Case, and also Boolean. I'm having no success getting it to work. Any help would be appreciated. This was my last try:
where
(case @Division
when 'M' then
case oh.division
when 'Management' then 1
when 'In-House' then 1
else 0
end
when 'B' then
case oh.division
when 'Brokerage' then 1
when 'In-House' then 1
else 0
end
when 'A' then
case oh.listdiv
when 'c' then 0
else 1
end) = 1