Field Searches

G

ganderson

How do I get a search form to find matches from more than
on field of my database? My custom query looks like
this:
SELECT * FROM Product_Query WHERE (ProductName
LIKE '%::Search::%' OR Category LIKE '%*Category*%' OR
Brief_Description LIKE '%*Brief_Description*%' OR
Long_Description LIKE '%*Long_Description*%' OR Brand
LIKE '%*Brand*%' OR Merchant_Name LIKE '%
*Merchant_Name*%' OR ProductName LIKE '%*ProductName*%').

But I am only able to get search results for the
ProductName field.

Does anyone know what changes i need to make to my query?
 
K

Kevin Spencer

There's nothing wrong with your query. You must have told the wizard you
only wanted that one field to display. The query is fetching all (*) columns
(fields) from the table. Oh yes. One other thing. Replace the "*"s that
you're using for wildcards, with "%" characters instead. The "%" character
is the SQL wildcard character.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
The more I learn, the less I know.
 
Top