|
-
Feb 5th, 2001, 12:26 AM
#1
Thread Starter
Junior Member
hi all a total newbie here first week with this stuff.
I got a html form that passes info to asp page.
select name="price"
option value="200" $0-$200 /option
option value="400" $200-$400 /option
/select
SQL = "SELECT * FROM table WHERE price<"&Request.Form("price")&"
if select option value="400" it shows all items less than 400 when i only want to display items from 200-400.
Is this making sense. Do i need some vb script somewhere to make this work or is the SQL wrong
Cheers
newbie
-
Feb 5th, 2001, 07:18 AM
#2
Fanatic Member
Hi micksterbooty
As long as the value's are always incrementing by 200 you can use the following
Dim selectvalue
selectvalue = Cint(Request.Form("price"))
SQL = "SELECT * FROM table " & _
"WHERE price>=" & (selectvalue - 200) & "AND price <= " & selectvalue
hope it helps
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Feb 5th, 2001, 10:35 AM
#3
Thread Starter
Junior Member
cheers ian it works a treat.
I tried adding another condition to the WHERE
but getting confused with syntax
SQL = "SELECT * FROM surfboardtable " & _
"WHERE price>=" & (selectvalue - 200) & "AND price <= " & selectvalue
AND state='"&Request.Form("state")&"'
thanks again
mick
-
Feb 5th, 2001, 10:47 AM
#4
Fanatic Member
This is what you need. the _ is just to include the string on the next line just use the following
Code:
SQL = "SELECT * FROM surfboardtable WHERE price >= " & (selectvalue - 200) & " AND price <= " & selectvalue & " AND state='"&Request.Form("state") &"'"
Hope it helps
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Feb 5th, 2001, 11:23 PM
#5
Thread Starter
Junior Member
cheers ian you are a legend.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|