i have this statement in access:
SELECT *
FROM accountsnew
WHERE [Panels] not like '*IT_OXYC,*' and [Panels] not like '*OXY_SN,*' and [Panels] not like '*OXY_S,*' and [Panels] not like '*OXY_N,*' and [Panels] like '*OXYC_SNEG,*' or [Panels] like '*OXYC_PNEG,*';
for some reason it is not returning the proper dataset. when i look more deeply at the data returned, using excel, i see that what it returned in fact DID contain IT_OXYC, and some other parameters.
is there something wrong with my statement?
i am trying to get all records which do not have IT_OXYC, OXY_SN , OXY_S, etc… and DO have either OXYC_SNEG, or OXYC_PNEG,
Your logic is wrong. Translating your request bit-by-bit:
SELECT * FROM accountsnew
WHERE NOT (…)
(x LIKE ‘IT_OXYC‘ OR x LIKE ‘IOXY_SN‘ OR x LIKE ‘OXY_S‘ OR …)
AND (x LIKE ‘OXYC_SNEG‘ OR x LIKE ‘OXYC_PNEG‘)
Putting it all together: