Hi Venelina,
You might try this:
testit = "Select * From wamtxt Where wamtxt.txtext LIKE %"+alltrim(mfrt2)+"%
SQLPREPARE(gnHandle1,testit, 'mySeeThis1a')
You can set step on and look at testit in the debugger to see if it appears to be parsed correctly. If so, then you can place the Select statement back into the sql prepare.
Also, you can place a variable in front of the sql statement to catch the return code and determine which code is returning a -1 like:
ret_val = SQLEXEC(gnHandle1)
sometime this helps to determine exactly where the error occurred but not always. The SQL prepare almost always return a 1, even though the database server returns a -1 when it tries to execute the SQL prepared parse.