RE: OT - sql query

by Francois de Beer <fbeer(at)sars.gov.za>

 Date:  Thu, 23 Mar 2000 10:44:48 +0200
 To:  "Laurie M. Landry" <lmlweb(at)lmlweb.com>,
hwg-techniques(at)hwg.org
  todo: View Thread, Original
>>But I'd like the sql to look into all columns for the possible match

I beleive you could go:

Dim SQLStr
SQLStr = "SELECT * FROM Customers where Country LIKE '%" &
Request.QueryString("keyword") & "%' or company LIKE '%" &
Request.QueryString("keyword") & "%' or city LIKE '%" &
Request.QueryString("keyword") & "%' or title LIKE '%" &
Request.QueryString("keyword") & "%'" 

Response.write "<p> SQL Sring = " & SQLStr & "</p>"

This Should return (for Example Keyword = "MyKeyword")

SQL String = SELECT * FROM Customers where Country LIKE '%MyKeyword%' or
company LIKE '%MyKeyword%' or city LIKE '%MyKeyword%' or title LIKE
'%MyKeyword%'

It will only search through the columns which you ask for ie. : 

where Country LIKE '%MyKeyword%'
or city LIKE '%MyKeyword%'
or company LIKE '%MyKeyword%'

HWG hwg-techniques mailing list archives, maintained by Web Professional Association - IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.