OT - sql query

by "Laurie M. Landry" <lmlweb(at)lmlweb.com>

 Date:  Wed, 22 Mar 2000 14:32:32 -0800
 To:  <hwg-techniques(at)hwg.org>
 References:  ms
  todo: View Thread, Original
Hi,

I know this isn't entirely part of the HTML domain, but I'm hoping someone
can give me a quick hand here:
I'm using ASP to interact with a database, and i'm stuck on a sql query
thing. (yes, I'm absolute beginner when it comes to asp and sql).

I have this simple query search form where you just type in a keyword, and
the ASP file with the sql will look into 6 different columns (company, name,
title, address, city, country) to find the closest match to the keyword
entered

The sql I have right now works, sort of, as it only looks into a specified
column (in this case country):

SELECT * FROM Customers where Country LIKE '%" &
Request.QueryString("keyword") & "%%%'"

This will work as long as you enter in a country name. But I'd like the sql
to look into all columns for the possible match, and I've tried OR (and
lists every single record) and I've tried AND (and lists nothing). There
must be something that will tell the sql to look in all of the columns for
this keyword given.

I would appreciate it if someone can help me!

TIA,
Laurie

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA