Jump to content

Can't get price search to work


mann95

Recommended Posts

I'm trying to create a search facility which will allow users to find products according to price. I have created two drop down menus which will allow users to search between two values. I have assigned the variable name "lowstring" to the first drop menu and "highstring" to the second drop down menu. The two variables are being taken from the form successfully. I am not sure whether i have written the sql correctly or if I should have used a less than and greater than.

<%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("\n0253071\db\assignment1.mdb"))set rs = Server.CreateObject("ADODB.recordset")lowstring=Request.form("lower")highstring=Request.form("higher")rs.Open "SELECT * FROM Books WHERE Price BETWEEN '%" & highstring & "%' AND '%" & lowstring & "%' ORDER BY BookTitle",conn%>

Any help much appreciatedCheersCM

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...