Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 August 19th, 2004, 11:26 PM
SoC SoC is offline
Authorized User
 
Join Date: Jul 2004
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL search

I have some web pages that enable users to search a database.

They can type in a keyword or phrase in a text area, and select one or more checkboxes to narrow the search.

This works well, except I would like the keyword search to be a bit more flexible.

At the moment, my SQL is effectively like this:

SELECT *
FROM myTable
WHERE myFieldNames
LIKE '%texfieldVariable%'

So I'm using LIKE and the wildcard operator at the start and end of the keyword.

This is the problem:
Say I have the following text in a field:

"we are the knights who say ni!"

If the user enters "the knights", they will retrieve the record, however, if they enter "the knight who say ni", they do not get the record.

Is there any way of making this type of keyword more flexible in SQL?

Thanks

SoC


 
Old August 20th, 2004, 08:52 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can't achieve that using like operator. May be you can try that with fulltext searching feature of SQL server. I am not sure if you are using SQL server/MSAccess.

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to search db for all triggers and list SQL tcarnahan SQL Server 2000 1 September 1st, 2008 10:42 AM
Regarding search in SQL SERVER 2005 comvidyarthi SQL Language 0 March 27th, 2007 09:35 AM
Google-like SQL search jemaj21 Access VBA 2 April 7th, 2006 09:52 PM
Quesetion about search and SQL data control HoosierDaddy61 ASP.NET 2.0 Basics 3 February 25th, 2006 05:13 AM
Search and update SQL database if value is changed jakvike VBScript 1 August 4th, 2004 06:32 AM





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