LIKE giving me fits

Results 1 to 3 of 3

Thread: LIKE giving me fits

  1. #1
    Join Date
    Dec 1969
    Posts
    866

    Default LIKE giving me fits

    I am trying to adapt an amateur DB to ASP for the Intranet and the bleeding SQL statement will not return any data, but, when run the exact same statement in Access, it works perfectly?!<BR>Here&#039s the statement: <BR>SELECT * FROM TableName WHERE ColumnName LIKE &#039*help*&#039 <BR>Please help.

  2. #2
    Shawn Clabough Guest

    Default RE: LIKE giving me fits

    Try "SELECT * FROM TableName WHERE ColumnName LIKE &#039%help%&#039" <BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    730

    Default RE: LIKE giving me fits

    ASP does not like the * character, you must use the % character.<BR>I found that a statement such as this:<BR>SELECT * FROM TableName WHERE Field LIKE &#039%%somevalue%%&#039<BR>does work in some instances, it is better to offset the value with another % character<BR>SELECT * FROM TableName WHERE Field LIKE &#039%%somevalue%%%&#039<BR>This method works well for the MicroSoft FrontPage Database Region Wizard. It doesn&#039t work well with your own code.

Posting Permissions

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