Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 17th, 2005, 06:55 AM
Authorized User
 
Join Date: May 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with "where = " select statement

I am using a where = statement (in asp.net)

WHERE = "my_value"

("my_value is a variable a user passes entering a Form)

It works fine only if the user's search matched exactly my database value: say if he entered 'Martin Scorsese'

However if he entered only "Scorsese" his search does not give any result.
Any way out with this?
Many thanks
Shirley

 
Old October 17th, 2005, 06:59 AM
Authorized User
 
Join Date: Sep 2005
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use WHERE LIKE '%my_value%' instead

http://sqlservercode.blogspot.com/
 
Old October 17th, 2005, 08:10 AM
Authorized User
 
Join Date: May 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will have a go and let you know.
Many thanks

 
Old October 17th, 2005, 04:07 PM
Authorized User
 
Join Date: May 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

WHERE Titolo LIKE '%"+requestedValue+"%'

it works perfectly
many thanks!:)






Similar Threads
Thread Thread Starter Forum Replies Last Post
New Bie- Select Statement problem sparsh2010 Access VBA 1 January 22nd, 2008 01:00 PM
Problem with SELECT INTO statement 132591 SQL Language 1 November 27th, 2006 06:58 AM
SQL select statement problem shrisangeeta Classic ASP Databases 3 June 15th, 2006 10:28 AM
Problem with select statement s.abraham ASP.NET 1.0 and 1.1 Basics 2 March 24th, 2005 02:29 PM
SELECT statement...strange problem abbylee26 Classic ASP Databases 7 March 16th, 2004 02:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.