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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing multiple form variables for result selection criteria

Status
Not open for further replies.

credo

Programmer
Jul 26, 2001
50
0
0
GB
Hi,
I am trying to pass some variables across from a Search page form to a Results page to use as filtering criteria and am struggling.

My Search form consists of 3 radio buttons (to allow users to define the result set sorting order eg. price, resort, rating etc...) and a drop down list box of UK dates retrieved dynamically from Access2000 db.

On the Search form I am using GET to append the variables to the URL and can see that they are going across to the results page as

localhost/latedeals_results.asp?btn_resort=radiobutton&sel_depDate=11%2F30%2F2001&cs_btn=Search

sel_depDate is the name of my drop down list of dates on the search form.

In the result page, the result set SQL I am using includes a variable 'varDate' which is set to default value of #30/11/2001# and
a runtime value of 'Request.QueryString("sel_depDate") . . .
When testing this query from withing the results page it works, but when choosing a date that I know is in the db on the search page, no results are returned.

My query is
SELECT *
FROM Tbl_LateDeals
WHERE Tbl_LateDeals.departure_date = varDate (no quotes - as returned an error)

(I'm not sure if the %2F (backslash) is causing the problem.
Also to allow sorting do I just need to add order by in the query using btn_resort (all radio buttons named the same in search form)?

any help will be appreciated
 
for ordering, name all the radio buttons the same e.g.radio_order and their values should correspond the field names that you want to order, (price, etc.)

for the sql statement try
SELECT *
FROM Tbl_LateDeals
WHERE Tbl_LateDeals.departure_date = 'varDate'
ORDER BY varorder


have the varorder with a runtime value of Request.QueryString("radio_order")

as far as the date goes...are you sure that the date pulled from the access database is the same as the one in the results...when i was trying it e.g. 06/22/01 wasn't the same as 6/22/01.

let me know if it works out ok

Jeevenze
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top