>>Hi
>>I want to search the last record having some text
>>
>>mytext="ABC"
>>?SQLEXEC(lnHandle,"select ac from account where ac like '%'+mytext+'%' order by ac desc limit 1","tmp")
>>this return value -1
>>but
>>?SQLEXEC(lnHandle,"select ac from account where ac like '%ABC%' order by ac desc limit 1","tmp")
>>return value 1
>>
>>so how to combine "%" together with variable mytext ?
>
>You want to put the % inside the variable and pass as a parameter
>mytext = "%ABC%"
>?SQLEXEC(lnHandle,"select ac from account where ac like ?mytext order by ac desc limit 1","tmp")
Yes, I think this is the solution we came to in another thread, thanks.
If it's not broken, fix it until it is.
My Blog