Im trying to perform a search (data stored in MS Access DB) and the form Im using allows the following values:
- criteria1_minimum
- criteria1_maximum
those are stored in the database with datatype set to number.
Also on the form I have 8 specific regions (counties), setup as check boxes with unique names (i.e. field_county1, field_county2, etc.) -- so that the user can either search ALL the counties (i.e. all are checked) or filter by clearing some check boxes)
The first part, the comparing of the number values works when it exists alone, but when I try to add the portion of the sql select statement that handles the county selections it returns matches that DONT actuaally fall within the criteria specified in the search parameters.
Here is the sql select statement Im using:
What am I doing wrong or how can I get this to work? Im somewhat familiar with ASP, but as you can tell by now, far from a PRO.
(note: near the end of the sql select statement, the values county'x'Val are used to hold the request.form variable for the county check boxes)
Help?!?!
- criteria1_minimum
- criteria1_maximum
those are stored in the database with datatype set to number.
Also on the form I have 8 specific regions (counties), setup as check boxes with unique names (i.e. field_county1, field_county2, etc.) -- so that the user can either search ALL the counties (i.e. all are checked) or filter by clearing some check boxes)
The first part, the comparing of the number values works when it exists alone, but when I try to add the portion of the sql select statement that handles the county selections it returns matches that DONT actuaally fall within the criteria specified in the search parameters.
Here is the sql select statement Im using:
Code:
... = "SELECT * FROM Tbl_MyTbl WHERE Acreage >= request.form("value1") And Acreage <= Request.form("value2") And MaxPrice <= Request.form("pricevalue") And County = '"&county1Val&"' Or County = '"&county2Val&"' Or County = '"&county3Val&"' Or County = '"&county4Val&"' Or County = '"&county5Val&"' Or County = '"&county6Val&"' Or County = '"&county7Val&"' Or County = '"&county8Val&"' "
What am I doing wrong or how can I get this to work? Im somewhat familiar with ASP, but as you can tell by now, far from a PRO.
(note: near the end of the sql select statement, the values county'x'Val are used to hold the request.form variable for the county check boxes)
Help?!?!