Forums

This topic is locked

Searching For A Word In More Than One Field

Posted 28 Aug 2003 19:00:19
1
has voted
28 Aug 2003 19:00:19 Michael Bolgiano posted:
I'm using dreamweaver to build a web site, and as we all know, it's SQL expression builder leaves much to be desired.

What I have is a database with about 10 fields. Two of those are D1 and D2, for the two descriptions. This database is updated weekly, and is always in this format. I don't want to make any changes to the design of this table in this database, because I'll need to import it every week.

What i would like to do is let users be able to search for any given keyword and have the SQL check BOTH fields before giving up. Right now I have a kludge of a system going, where I essentially do the following:

<% create recordset SELECT * FROM CATALOG WHERE D1 = Request.Form("desc" %>
<% if recordset.Eof then %>
<% create recordset SELECT * FROM CATALOG WHERE D2 = Request.Form("desc" %>

<% end if %>

<rest of web page>

So how can this be done?

Thanks for your help.

Reply to this topic