I am trying to deal with an apostrophe in a prompt field in my SQL statement. Example below :
WHERE propertyfieldintable=@promptfromuser
The problem is that there are addresses with an ' eg. Wood's therefore the SQL works for all other addresses except those with an '.
I have tried to use replace(@promptfromuser,"'","''")
but keep getting an error (missing right '). The propertyfieldintable
is a text field so am assuming it needs a text input from the prompt.
I would appreciate any straightforward suggestions as the query is not in the database itself but sits within a reporting tool so can't take functions.