markloessi
asked on
Not Equals in MS Access Query
Because there is an "AND" following your 'not equal' condition, that has a good chance of causing the problem. Whenever 'not equal' is combined with an "AND" in a WHERE clause, the entire WHERE clause needs to be known.
It's not always intuitive why it goes wrong, but it's usually easy to spot.
It might even affect the result with "NOT IN()".
Please show the entire clause if the problem continues.
Tom
It's not always intuitive why it goes wrong, but it's usually easy to spot.
It might even affect the result with "NOT IN()".
Please show the entire clause if the problem continues.
Tom
I don't see any joins with the tables you have shown in your screenshot.
I don't know if they are part of your SQL (Query) or not, but just want to mentioned it in case they are.
I don't know if they are part of your SQL (Query) or not, but just want to mentioned it in case they are.
To clarify, the "AND" isn't necessarily exactly the problem; but it indicates that there is more of the WHERE clause than we can see. It will be the totality of the WHERE clause that will be important when "not equal" is part of it.
RichardRost's suggestion to build the WHERE clause a segment at a time is a very good one. At some point of complexity, you should see that results get off track. That will be the point when the parts of the WHERE clause need explanation.
Tom
RichardRost's suggestion to build the WHERE clause a segment at a time is a very good one. At some point of complexity, you should see that results get off track. That will be the point when the parts of the WHERE clause need explanation.
Tom
It would be very helpful if you can post the whole SQL statement you have.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Agreed with peter57r
this is best option
WHERE (BI.NRS_STATION Not In (Select NRS_STATION_CODE] from [NRS_STATION_IGNORE]))
this is best option
WHERE (BI.NRS_STATION Not In (Select NRS_STATION_CODE] from [NRS_STATION_IGNORE]))
WHERE (BI.NRS_STATION Not In (Select NRS_STATION_CODE] from [NRS_STATION_IGNORE]))