Solved

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

Posted on 2011-03-25
5
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 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