Results 1 to 2 of 2

Thread: SQL/Access/ASP

  1. #1
    Join Date
    Dec 1969

    Default SQL/Access/ASP

    I have a search function on my webpage which uses drop-down menus to search through arrays in the web page, using Javascript.<BR>i.e. User selects from the first menu which populates the second menu. Then the user selects from the second menu and this populates the third menu. the user finally selects from the third menu and then hits submit.<BR><BR>I have an ASP page which is opened when the user presses submit. I want this to have an SQL query which uses the information the user has selected from the drop-down menus to find the available product(s) in my MA Access DB.<BR><BR>I am a noivce with sql and was wondering if anybody has got ideas on what the sql query should look like?

  2. #2
    Join Date
    Dec 1969

    Default It's all very, very vague, but...

    ...depending on the names of the combo boxes, the name of the table in your DB, etc. it should look something like:<BR><BR>SELECT * FROM MyTable WHERE TheFirstField = &#039;&#060;insert value from first drop-down menu here&#062;&#039; AND TheSecondField = &#039;&#060;insert value from second drop-down menu here&#062;&#039; AND TheThirdField = &#039;&#060;insert value from third drop-down menu here&#062;&#039;;<BR><BR>This would select all rows from MyTable which match ALL three values selected in the drop-down menus. If you want all rows which match EITHER one, two or three of the values, simply replace AND with OR.<BR><BR>I hope this helps,<BR>Oliver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts