Solved

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

Posted on 2011-03-25
5
257 Views
Last Modified: 2012-08-14
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.

0
Comment
Question by:gs99
  • 2
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 125 total points
ID: 35220513
Have you tried:

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

Open in new window

0
 
LVL 13

Expert Comment

by:gamarrojgq
ID: 35220533
Hi,

Have you try to use LIKE operator?  

h.hierarchy_string NOT LIKE "*" & SA & "*"
0
 

Author Closing Comment

by:gs99
ID: 35245208
Sorry for the delay.
Your suggestion works OK.

Thanks for your help.
0
 

Author Comment

by:gs99
ID: 35245236
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
 
LVL 13

Expert Comment

by:gamarrojgq
ID: 35245250
ok great you solved
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question