I am using an .adp file which is connected to the SQL
Server. I have created a query stored procedure. I now
am trying to search through one field, called NOTES, for
whatever the user inputs. In the criteria cell for the
column NOTES I type in:
LIKE "%" & @userinput & "%"
Userinput is basically the message box that appears so
the user can enter a phrase to search for. This does not
seem to work. Anybody have any solutions. Thank You!
Sylvain Lafontaine - 27 Feb 2004 05:46 GMT
You must add single quote ( ' ) to delimit strings in SQL:
LIKE "'%" & @userinput & "%'"
You must also take care that there are no single quote in the @userinput or
to replace them with 2 single quotes. In VBScript: userinput = replace
(userinput, "'", "''"). Sorry, I don't remember the exact syntaxe for doing
this in T-SQL right now.
S. L.
> I am using an .adp file which is connected to the SQL
> Server. I have created a query stored procedure. I now
[quoted text clipped - 7 lines]
> the user can enter a phrase to search for. This does not
> seem to work. Anybody have any solutions. Thank You!