Getting results on

Results 1 to 2 of 2

Thread: Getting results on

  1. #1
    Matthew Laycock Guest

    Default Getting results on

    I&#039;m trying to put in a static link pulling info out of our database. in URL I&#039;m calling search criteria the problem is i want the search to only bring up results on an exact phrase match not on all the words, So what I have is <BR> &Name=wordone+wordtwo+Wordthree+<BR><BR>So the results give is all records with any of the words, how would I narrow it down to results only with all the words?

  2. #2
    J. Paul Schmidt Guest

    Default Search For Phrase

    To have a SQL statement show all recs where Name has the phrase in the querystring&#039;s Name variable:<BR><BR>strSQL = "SELECT * FROM MyTable WHERE Name Like &#039;%" & Request.QueryString("Name") & "%&#039;"<BR><BR>But you may want to use the VBScript&#039;s Replace() function to double up any single quote characters.<BR><BR>Best regards,<BR>-Paul<BR><BR>J. Paul Schmidt, MBA<BR>Databases on the Web<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