Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP,SQL help 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Is it possible to to have conditions based on a query? I have a form where the user can select multiple search criteria. Some of the crieria if selected will clash with other criteria selected. Can I have a statement that will say if one field is selected then these other variables will have different values? I appreciate any help.
 
Yes you can.
Look:

var1=request("var1")
var2=request("var2")

if var1<>&quot;&quot; then
var2=&quot;other_value&quot;
end if

SQL=&quot;SELECT * FROM table WHERE colum1=&quot; & var1 & &quot; AND colum2=&quot; & var2
...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top