Jaime Aviles


Hello to all, i am working with sql server 2000 and vfp 9 and have no idea how to quaery using a like %text1% in a select statement, could you help me please

cn=sqlconnection("local server")

=sqlexec("use fianzas")

sqlstring="select * from soc_socios where nombre like "+ what¡¯s come here

=slqexec(cn,sqlstring,"c_cursor1")

thanks




Re: How to me a select using LIKE in sql server 2000 vfp 9

Rick Borup


You just need to enclose %text1% in single quotes within the double quotes, like this:

sqlstring = "SELECT * FROM soc_socios WHERE nombre LIKE '%text1%'"







Re: How to me a select using LIKE in sql server 2000 vfp 9

CetinBasoz

Code Snippet

lcSearchExpression = "%findme%"

sqlString = "select * from soc_socios where nombre like m.lcSearchExpression"

SqlExec( m.cn, m.sqlString, "c_cursor1")