navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

search sql with multiple criteria

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> search sql with multiple criteria
Page: [1]
 
crosscreek

 

Posts: 107
Joined: 2/5/2008
Status: offline

 
search sql with multiple criteria - 4/16/2008 21:53:13   
Working on a search form with multiple entries. I think I can create the asp code for this, but working on the SQL for the criteria inputted. (YES THE DOG DATABASE)

Example.

Search Form:

Color:
color factor:
location:
price range:

Results.asp

col = request.form("color")
factor = request.form("factor")
location = request.form("location")
price = request.form ("Price")

select * from tbldog where color = col AND factor = factor AND location = location And price = price.

I know how to make the SQL to match all the criteria inputted, but how do I handle if someone what's to find matches to part of the criteria.

Do I need to break up the code into several parts.

For example if someone wants to see all the dog that are located in Texas.

col = all
price = all
location = TX
factor = all

OR texas dog's that are chocolate factored

col = all
price = all
location = TX
factor = choc










rdouglass

 

Posts: 9167
From: Biddeford, ME USA
Status: offline

 
RE: search sql with multiple criteria - 4/16/2008 23:02:03   
This thread is full of stuff - code and links - about doing what (I think) you want to do:

http://www.frontpagewebmaster.com/m-240541/key-on%252Dthe%252Dfly/tm.htm#240577

That help any?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to crosscreek)
crosscreek

 

Posts: 107
Joined: 2/5/2008
Status: offline

 
RE: search sql with multiple criteria - 4/17/2008 11:45:23   
PERFECT :)

That's exactly what I needed to find out....

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> search sql with multiple criteria
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts