Solved

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

Posted on 2011-03-25
5
230 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 74

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now