Link to home
Start Free TrialLog in
Avatar of gs99
gs99Flag for United States of America

asked on

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.

ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gamarrojgq
gamarrojgq

Hi,

Have you try to use LIKE operator?  

h.hierarchy_string NOT LIKE "*" & SA & "*"
Avatar of gs99

ASKER

Sorry for the delay.
Your suggestion works OK.

Thanks for your help.
Avatar of gs99

ASKER

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?
ok great you solved