SQL coding: Finding singular when search with plural.

2002-03-06 Thread BadgerBay
Hello, This is a good question for when you are sipping coffee or tea and are inspired to write some code. I require additional functionality for my SQL search: MY CURRENT SEARCH SELECT ID, Authors, Year, Title FROM libraryTable WHERE (Authors LIKE '%" + varAuthor + "%') OR (Keywords LIKE '%" +

Re: Query returns all records when a search box is empty

2001-12-23 Thread BadgerBay
Hi, The part: AND 'varAuthor' <> '' is a test to see if the variable is empty or NULL -Michael > Uh, I think the problem is that if nothing is entered, you search for '%' + > nothing + '%' , so in effect, you search for '%%' , which is everything. > > Have your code check if the fields you're s

Query returns all records when a search box is empty

2001-12-23 Thread BadgerBay
When I do a search for Author, Keyword, or Title and I leave a search box blank, the search is returning ALL records in the database: I only want it to return records from fields that match with the search criteria. I exported the database from MSAccess (with ALLOW ZERO LENGTH set to YES and REQ

Simple problem: Blank search box returns all records

2001-10-26 Thread BadgerBay
How do I avoid search problems when a user leaves a search box empty on an Ultradev search page running jserv and attached to a MySQL database? I have three search boxes: Author, Title, and Keyword The user enters the search data into one, two, or all three of the fields, and presses "SUBMIT" (I