Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Search from asp to sql

Author  Topic 

alxtech
Yak Posting Veteran

66 Posts

Posted - 2007-10-18 : 09:40:53
hello forum,
i have this asp form that searches for records depending on user input or selection, these are the form fields:
zip code text box
category drop down box
pro number text box
site number text box
start date text box
design date text box
plus mil radio button
lese mil radio button

none of the fields is required, user can select one or more fields to do the search. currenlty if a user selects a category and site number the application returns all records that contains that category and input site number, but in reality there is only one record in db that contains category and a site number as site number is unique.

this is my query:
Note: i am using session to store the values input in the form

"SELECT zip,category,proNumber,siteNumber,startDate,designDate,totalMil FROM finalTable where zip='" & session("zipSession") & "' or category='" & Session("categorySession") & "' or pronumber='" & Session("pronumberSession") & "' or sitenumber='" & session("sitenumberSession") & "' and startdate>='" & Session("startdateSession") & "' and designdate>='" & Session("designdateSession") & "' and totalMil>='" & Session("totalMilSession") & "' "







Kristen
Test

22859 Posts

Posted - 2007-10-20 : 04:45:04
This question was discussed over here:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=91214
Go to Top of Page
   

- Advertisement -