Not sure if SQL is appropriate to post on here but thought I would give it a try.
I am trying to create a query which will filter results based on multiple criteria.
So for example,
Select
MyData1, MyData2, MyData3
From
MyDataBase
Where
MyData1 = "Criteria"
AND (MyData2= NOT LIKE '%AGR%' AND MyData3 <> "AB")
AND (MyData1= NOT LIKE '%STR%' AND MyData3 <> "CD")
I want to EXCLUDE any record where BOTH %AGR% is present somewhere within MyData2, AND MyData3 is AB
I want to EXCLUDE any record where BOTH %STR% is present somewhere within MyData1, AND MyData3 is CD
However, if %STR% or %AGR% is present with a MyData3 value of "EF", it WILL list.
I can't figure out if my method of testing this is flawed or if the syntax is incorrect, could someone please verify?
Bookmarks