multiple requests

Results 1 to 3 of 3

Thread: multiple requests

  1. #1
    Join Date
    Dec 1969

    Default multiple requests

    I have an sql statement that is supposed to pull up multiple requests. The problem is in my sql statement where I set my record to the requested value such as: "where ac = '" & request("ac") & "'". These two never equal each other because the requested value is layed out as two or more records, such as "one two three". I would like to be able to separate these requests but not sure how. Then my for-next loop would work correctly.

  2. #2
    Join Date
    Dec 1969

    Default ASPFAQs, category Databases, Queries

    The link to the ASPFAQs is at the top right corner of most every page on this site, including this one.<BR><BR>In this case:<BR><BR><BR><BR>Now, that doesn&#039;t show you *precisely* your answer. In your case, you have only one form field but multiple values.<BR><BR>But the principle is the same:<BR><BR>&#060;%<BR>...<BR>values = Split( Request("ac"), " " ) &#039; split on spaces<BR>where = "" &#039; we will build the WHERE clause...<BR>delimiter = " WHERE "<BR><BR>For fnum = 0 To UBound( values )<BR> &nbsp; fval = Trim( values(fnum) )<BR> &nbsp; If ("X" & fval) &#060;&#062; "X" Then<BR> &nbsp; &nbsp; &#039; one LIKE clause, for this value...<BR> &nbsp; &nbsp; &#039; (of course, this could be an = test instead of LIKE)<BR> &nbsp; &nbsp; where = where & delimiter & " ac LIKE &#039;%" & fval & "%&#039;"<BR> &nbsp; &nbsp; &#039; change delimiter to the conjunction now!<BR> &nbsp; &nbsp; delimiter = " OR " &#039; this might be " AND " instead!<BR> &nbsp; End If<BR>Next<BR>...<BR>%&#062;<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: multiple requests

    learn to use and / or<BR><BR>the two fields have to = the requested items<BR><BR>Select * From Table Where onefield=&#039;This&#039; and anotherfield=&#039;somethingelse&#039;<BR><BR>eith er field can equal one of the requested items<BR><BR>Select * From Table Where onefield=&#039;This&#039; Or anotherfield=&#039;somethingelse&#039;<BR>

Posting Permissions

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