Database query

W

Workinghard

Currently i am using the following sql statement:

SELECT * FROM INVENTORY WHERE (ITEMS like ::ITEMS::)

And so Using the following: resultspage.asp?ITEMS=nevada

I get all ITEMS from nevada.

My question is what do I need to change in the SQL Statement above in order
that a statement such as:

resultspage.asp?ITEMS=nevada&PRICE<1000

will yield all Nevada ITEMS and with PRICE under $1000
 
S

Stefan B Rusynko

SELECT * FROM INVENTORY WHERE (ITEMS like ::ITEMS:: AND ::pRICE::<1000)

(provided PRICE is a numeric field)

PS
This has nothing to do with your page link since you are using a Select statement to filter your DB
- resultspage.asp?ITEMS=nevada&PRICE<1000
For an example how to use forms to filter your DB see http://www.asp101.com/samples/db_pulldown_linked.asp



| Currently i am using the following sql statement:
|
| SELECT * FROM INVENTORY WHERE (ITEMS like ::ITEMS::)
|
| And so Using the following: resultspage.asp?ITEMS=nevada
|
| I get all ITEMS from nevada.
|
| My question is what do I need to change in the SQL Statement above in order
| that a statement such as:
|
| resultspage.asp?ITEMS=nevada&PRICE<1000
|
| will yield all Nevada ITEMS and with PRICE under $1000
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top