"LIKE %" AND "@PARAM"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vag
    New Member
    • Jul 2007
    • 2

    "LIKE %" AND "@PARAM"

    This is going to be easy for any of you who is experienced.
    What is wrong with the following query?

    Select Company from Generalview Where Company Like '%'@search'%'
  • gpl
    New Member
    • Jul 2007
    • 152

    #2
    Originally posted by vag
    This is going to be easy for any of you who is experienced.
    What is wrong with the following query?

    Select Company from Generalview Where Company Like '%'@search'%'
    You are searching for fields whose literal value is '@search' (ok, it isnt as it is not a valid string ... try this

    Like '%' + @search + '%'

    Graham

    Comment

    • vag
      New Member
      • Jul 2007
      • 2

      #3
      Thank you very much Graham!
      That worked indeed.

      Comment

      Working...