Skip to content
Advertisement

Where clause only return one condition instead two using OR

I have a simple select statement like:

For some reason the WHERE clause is not working correctly. I filter by [A].[RegionKey] = 2 and [A].[RegionKey] = 3. So I want to get all items who have RegionKey 2 and 3, but it only get values with RegionKey 3, and I’m sure I have items with RegionKey 2 too.

What am I doing wrong with this WHERE clause?

Advertisement

Answer

Change this:

to this:

or this:

Then make sure the other conditions in the WHERE clause are correct, as it’s likely at least one of them is over-filtering.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement