Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

Multiple In Statement

I have 2 fields ... Branch and Salesperson... Can i write an In Statement to resemble this??

Branch in ('11') and Salesperson ('123') then 'Field3'... I tried a Case When, then statement and I couldnt get it to work.. Any ideas?
0
Mikeyman_01
Asked:
Mikeyman_01
1 Solution
 
pivarCommented:
Hi,

I'm not sure I understand. Are you looking for this:

SELECT CASE WHEN Branch='11' AND Salesperson='123' THEN 'Field3' END
FROM yourtable

or if you really like IN

SELECT CASE WHEN Branch IN ('11') AND Salesperson IN ('123') THEN 'Field3' END
FROM yourtable

Otherwise perhaps you could give some more details.


/peter
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now