Link to home
Start Free TrialLog in
Avatar of J C
J CFlag for United States of America

asked on

SQL filtering issue

My WHERE clause in my query must have faulty logic.

WHERE (rems.project.hidden = 0) AND (NOT (rems.jobsalesexti.prodcode IN ('0000Base', 'ELEVA', 'ELEVB', 'ELEVC', 'EXTCOL'))) AND (rems.jobsalesexts.paycode = '') OR
               (rems.jobsalesexts.paycode = 'Draw 1')

Open in new window


The second part of my filter works but the first part is ignored. Is there a way to structure this so that I can get the desired result?
ASKER CERTIFIED SOLUTION
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America 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 J C

ASKER

Right now the issue is that the filter expression with the OR operator is working but the prodcode IN () is being ignored. Do you see any reason why the filter expression as a whole would not work?
Avatar of J C

ASKER

I'm sorry...You're solution did resolve my problem. Thank you!