Repeating this but using a different column

Results 1 to 2 of 2

Thread: Repeating this but using a different column

  1. #1
    Join Date
    Dec 1969

    Default Repeating this but using a different column

    Here my code pics up the querystring and searches the column for any matches<BR><BR>what I have though is two fields one that searches the authors column and one that searches booktitle is there any way of joining the search<BR><BR>&#060;% <BR>arrWORDS = Split(Request.QueryString("booktitle"), " ") <BR>strSearch = ""<BR>For Each strWord in arrWORDS<BR> strSearch = strSearch & " AND booktitle LIKE &#039;%" & strWord & "%&#039;"<BR> Next<BR> <BR> &#039;get rid of the first AND<BR> strSearch = Mid(strSearch, 5)<BR>%&#062;<BR><BR>rsRESULTS.Source = "SELECT * FROM Catmay3 WHERE " & strSearch<BR><BR>So the logic is<BR><BR>Select * FROM Catmay where author LIKE querystring(authors) AND/OR booktitle LIKE queryString(booktitle)<BR><BR>The above code works fine but is only searching the authors

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default response.write the SQL

    and post it here<BR><BR><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