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

understanding recordset WHERE clause that alludes to asp page variable

Status
Not open for further replies.

aonefun

Technical User
May 21, 2007
79
US
I have a fully functioning "store locator" web application that returns store location results based on a postal code form field.

I am taking this existing application and would like to filter the results using additional search criteria. To accomplish this, I am incorporating this application with a Dreamweaver extension that generates the advanced search code (DataAssist).

My question is as follows:
I need to pull apart the store locator application's recordset WHERE clause and place the criteria individually in the dialog box that will create the ultimate advanced search. I'm not too fluent in ASP/SQL so I'm not sure which items to retain from the following WHERE clause:

SELECT STATEMENT CODE:
Recordset1.Source = "SELECT * FROM Query1 WHERE LATITUDE <= " + Replace(Recordset1__HighLatitude, "'", "''") + " AND LATITUDE >= " + Replace(Recordset1__LowLatitude, "'", "''") + " AND LONGITUDE >= " + Replace(Recordset1__LowLongitude, "'", "''") + " AND LONGITUDE <= " + Replace(Recordset1__HighLongitude, "'", "''") + " "

THIS CODE PARTIALLY EXPLAINS THE VARIABLES USED IN THE SQL QUERY AND APPEARS BEFORE IT:
<%
Dim Recordset1__HighLongitude
Recordset1__HighLongitude = "00"
if (HighLongitude <> "") then Recordset1__HighLongitude = HighLongitude
%>

THIS IS THE WHERE CLAUSE GENERATED BY DATAASSIST EXTENSION FOR THE ADDITIONAL CRITERIA (OTHER THAN THE POSTALCODE RELATED CRITERIA)-IN CASE THIS HELPS:

WADbSearch1_whereClause=BuildFilterString("VendorPartNumber","" & cStr( Session("VendorPartNumber") ) & "","AND","=",0,WADbSearch1_wildCard,WADbSearch1_dateSeparator,WADbSearch1_whereClause)
WADbSearch1_whereClause=BuildFilterString("CustomText10","" & cStr( Session("Industry") ) & "","AND","=",0,WADbSearch1_wildCard,WADbSearch1_dateSeparator,WADbSearch1_whereClause)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top