Link to home
Start Free TrialLog in
Avatar of Rog D
Rog DFlag for United States of America

asked on

Need some help with TSQL Case Statement.

Current Statement

select emp.fullname,emp.dept,emp.deptLstnon9800 from ol_employee emp
where 'A'='A'
AND  (case emp.dept when '9800' then deptlstnon9800 else EMP.dept end  Not like  '45%')
AND  (case emp.dept when '9800' then deptlstnon9800 else EMP.dept end  Not like  '46%')
order by dept

Currently it just looks at emp.dep when '9800'.  I now need to also add  '4800' to the WHEN.  

Thought I coud just use "OR" or IN but neither work I get errors.  Looking for some assistance on how to do this.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of tim_cs
tim_cs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rog D

ASKER

Thanks.