Is there a way to indicate NOT Like to exclude rows?

I have this line of code that includes rows if value SA is found:
SqlMethods.Like(h.hierarchy_string, "%" & SA & "%")

I would like to add another similar criteria that Excludes rows if the value is found.

gs99Asked:
Who is Participating?
 
käµfm³d 👽Connect With a Mentor Commented:
Have you tried:

Not SqlMethods.Like(h.hierarchy_string, "%" & SA & "%")

Open in new window

0
 
gamarrojgqCommented:
Hi,

Have you try to use LIKE operator?  

h.hierarchy_string NOT LIKE "*" & SA & "*"
0
 
gs99Author Commented:
Sorry for the delay.
Your suggestion works OK.

Thanks for your help.
0
 
gs99Author Commented:
To gamarrojgg:
I could not get your solution to work.
h.hierarchy_string NOT LIKE "*" & SA & "*"
The NOT was not accepted for some reason.

but the solution from kaufmed does work in my case.

thanks for your suggestion; it may work for somebody else?
0
 
gamarrojgqCommented:
ok great you solved
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.