I need to return some access records where a field doesn't contain two specific text strings.
I am using the following to build the query
This executes but returns nothing and there are records in the table that meet the criteria so I'm assuming the 'Not Like' part isn't correct.
I have tried using a % instead of a * and multiple variants of using parenthesis to no avail......
Could anyone correct this for me?
TIA
I am using the following to build the query
Code:
strQuery = "SELECT InvDate, Agent, BoxRef, Supplier, Invoice FROM SageData WHERE (Supplier Not Like '*CNG*' AND Supplier Not Like '*Swalec*') AND InvDate = #" & Format(Range("Controls_ExcInvDate"), "m/d/yyy") & "#"
I have tried using a % instead of a * and multiple variants of using parenthesis to no avail......
Could anyone correct this for me?
TIA