Link to home
Start Free TrialLog in
Avatar of fahVB
fahVB

asked on

Case stmt

I have 2 diff fields, code which is always "1M" and inv_cd which is 001 and 002...in my following case stmt i would to say that if code is 1M then 'FM' but if inv_cd has 002 then SOLDMTG, in following stmt i am getting all FM even in some inv_cd there is 002, is this possible?


case when code = '1M' then 'FM' when inv_cd = 002 then 'SOLDMTG' end as PRODID
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

002 is char?

case when code = '1M' then 'FM' when inv_cd = '002' then 'SOLDMTG' end as PRODID

Open in new window

Avatar of fahVB
fahVB

ASKER

I tried with commas but still get all FM
Avatar of fahVB

ASKER

and yes it is char(3)
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg 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 fahVB

ASKER

i didn't know that, thank you ...it worked