query criteria for multiple NOT LIKE statements

gordytech

New Member
Joined
Jun 29, 2016
Messages
5
i am trying to create a query that does NOT show records with four different text strings. The text strings are not consistently written, so i have to use wildcards as well; for instance - - - - not like "*abc1 & "*" works fine but when i try to insert more than one it doesn't work - - - - supposedly, this works NOT LIKE ("*abc1" & "*","*ef5" & "*","*mn7" & "*","*S/S" & "*") but it doesn't
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Welcome to the Board!

I think you need to list each one out individually, i.e.
Code:
NOT LIKE (condition1) AND NOTE LIKE (condition2) AND NOTE LIKE (condition3) AND NOTE LIKE (condition4)
 
Upvote 0
Code:
select 
  *
from 
  tbl 
where 
(
  (
    field_1 NOT LIKE '*abc1*' 
  )
  and
  (
    field_1 NOT LIKE '*ef5*' 
  )
  and 
  (
    field_1 NOT LIKE '*S/S*' 
  )
)
 
Upvote 0

Forum statistics

Threads
1,221,814
Messages
6,162,128
Members
451,743
Latest member
matt3388

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top