Searching a table using LIKE

Results 1 to 2 of 2

Thread: Searching a table using LIKE

  1. #1
    Join Date
    Dec 1969
    Posts
    131

    Default Searching a table using LIKE

    What is the correct syntax for searching a table? My SQL IS LIKE THIS.........<BR>SQLsearch = "SELECT e.ID, e.Last_Name, e.First_Name FROM tblEmployee e WHERE searchname & " LIKE " & searchname <BR><BR>My error message is this.........Sub or Function not defined. The line number corresponds to where my SQL is executing. Please help!!!

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Searching a table using LIKE

    Ah! String concatenation problems! :(<BR><BR>What you need to do is check out this article:<BR><BR>To Quote or Not to Quote - That is the Question <BR>http://www.4guysfromrolla.com/webtech/013099-1.shtml<BR><BR>Your SQLsearch string is malformatted. It should be:<BR><BR>SQLsearch = "SELECT e.ID, e.Last_Name, e.First_Name FROM tblEmployee e WHERE searchname LIKE &#039" & searchname & "&#039"<BR><BR>assuming searchname is of a character type (Text, varchar, char, etc.) or a datetime.<BR><BR>Happy Programming!<BR><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
  •