Problem with SQL "LIKE" and Variable

Results 1 to 2 of 2

Thread: Problem with SQL "LIKE" and Variable

  1. #1
    Capnfunky Guest

    Default Problem with SQL "LIKE" and Variable

    Does anyone have a code clip that would clear up the syntax involved in querying using LIKE with a string.<BR><BR>For example<BR><BR>"SELECT * FROM sometable WHERE someattribute LIKE <BR>&#039%" & variable &"%&#039"<BR><BR>I guess there are too many &#039"%*&#@ &#039s for my feeble computer to handle and I have only a slight idea of which order they should be in.<BR><BR>Thanks in advance <BR>Capn<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    96

    Default RE: Problem with SQL

    That is the correct syntax. I&#039ve been using it for at least a year:<BR><BR>sql = "SELECT * FROM sometable WHERE someattribute LIKE &#039%" & searchString & "%&#039"<BR><BR>Maybe it&#039s something else that&#039s causing your problem.<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
  •