I am trying to write a nested case statement and I am getting an error. Please see a sample of what I am trying to do below:
Case when dbo.field1 in ('val1','val2') then 'test1'
When dbo.field1= 'val3' then 'test2'
Then I need to use the 'Newfieldname' in another case statement to create another field.
Case when 'Newfieldname' in ('test1','test2') then 'Yes'
How can I get this done?