SQL question > "Like" statement

Results 1 to 2 of 2

Thread: SQL question > "Like" statement

  1. #1
    Gero Bazant Guest

    Default SQL question > "Like" statement

    I have a text field containing different categories, such as: red, green, blue, etc. If I want to ask for all the records containing "red" in this field, shouldn&#039t the sql look something like this:<BR>sql = "SELECT * FROM tblCategory WHERE tblCategory.[Category] LIKE %" & cat & "%"<BR>(=&#062; cat = Request.Form("cat"))<BR>However, it doesn&#039t work... Please help...

  2. #2
    Gero Bazant Guest

    Default RE: SQL question > RETRACTION!

    Aside from the fact that I forgot the "&#039" when I entered the SQL statement into my question (it should have read:<BR>LIKE &#039%" & cat & "%&#039")<BR>it finally ended up working when I figured out that I was messing with the wrong connection...<BR>Sorry for wasting your time--but maybe it did help someone...

Posting Permissions

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