I'm trying to count records that does not include the texts mentioned in the query. The query works fine if I only use one text. If I use two or three texts after a comma it does not work. How could I get this working.
Any help would be appreciated.
Code: Select all
strSQL = "SELECT COUNT([Products]) FROM tblOrders WHERE [Products] NOT LIKE 'Apple%' 'Orange%'"
rst.Open strSQL, cnn, adOpenKeyset, adLockOptimistic, adCmdText
ws.Range("E24").CopyFromRecordset rst
rst.Close