>? SQLEXEC(1,"SELECT *; > FROM ZAKI.PROJ Proj; > WHERE {fn LEFT(Proj.PROJ_ID,6)} IN ('000609','000172','001113') AND {fn LENGTH(Proj.PROJ_ID)}=10; > ORDER BY Proj.PROJ_ID") > >mcproj="'000609','000172','001113'" > >? mcproj >? SQLEXEC(1,"SELECT *; > FROM ZAKI.PROJ Proj; > WHERE {fn LEFT(Proj.PROJ_ID,6)} IN (?mcproj) AND {fn LENGTH(Proj.PROJ_ID)}=10; > ORDER BY Proj.PROJ_ID") >This is a know problem [at least by me] that you can not parameterize an IN() clause. If your mcProg parameter just has 1 values in it, it will work. The problem is in having to have quotes around each value. There is no way to just pass '000609','000172','001113' without addition surrounding double-quotes. Now if you do not predefine the value of mcProj, and let VFP prompt you for the list, it will work with more than 1 value.
cSQL = "......." ; + "where .... IN ('" + mcProg1 + "', '" + mcProg2 + "') ..."I believe, IN (&mcProg.) will also work.