Are you using SQL Server?
If you were using Oracle, the query would be:
Code:
...
' WHERE EXTENSION_NO LIKE "'|| something1 || '"%' ...
NOTE: ... EXTENSION_NO LIKE (single tick)(double tick) || something1 || (single tick)(double tick)%(single tick) ... in the variation of SQL you are using, you'll switch single and double tick use.
I wonder if the name of the variable is being put into your query instead of the value...
JoeB