Just build the WHERE clause by adding pairs of type <column name> = <input
value> for each field that has been given a value.  Include delimiters
(quotes) as appropriate, check the input for valid values, and substitute
single quotes with double quotes in input strings.  Make sure you have at
least one criteria, join them with " and " and append to the Where clause.

If you are using SQL Server (or another full-fledged database) you can
implement the logic in a stored procedure and simply supply the values as
parameters.

HTH,
Tore.

-----Original Message-----
From: Jason Burton [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 3:18 AM
To: ActiveServerPages
Subject: ASP / SQL Query Question


I have a multi form field page,

I'm trying to figure out what the best way of
constructing the search would be. (building the query
string).. Theres about 7 fields, and I'd like to
somehow depending on if forms are empty still pull
results with any other 'filled in' field.

Does anyone have an example of this? or even something
I could go by? I'm really having difficulties with
this... and it's holding my project up that i'm trying
to get done ...

It'd be appreciated.

Thnx

Jason Burton
Hilite Industries (www.hilite-ind.com)
[EMAIL PROTECTED] (send to [EMAIL PROTECTED])

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

---
You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to