>lcSQL='SELECT Numero FROM News WHERE Year='+ALLTRIM(STR(lnYear)) >&lcSQL >>
>lcSQL='SELECT Numero FROM News WHERE Year=lnYear
>&lcSQL
>
>>lcSQL='SELECT Numero FROM News WHERE StartDate=CTOD('01/01/1999')
>&lcSQL
>
>lcSQL = 'SELECT Numero FROM News WHERE StartDate = {^'+; TRANSFORM(DTOC(ldDate,1),'@R 9999/99/99')+'}'But these conversions might get tedious to use. Instead I'd put parameters to a custom object and pass it as well. ie:
LOCAL oParams, lcSQL oParams = CREATEOBJECT('Custom') oParams.AddProperty('p_StartDate', {^1999/01/01}) oParams.AddProperty('p_EndDate', {^1999/10/22}) oParams.AddProperty('p_Title', 'VFP') lcSQL = '* FROM News'+; ' WHERE StartDate = toParams.p_StartDate'+; ' and EndDate = toParams.p_EndDate'+; ' and atc(toParams.p_Title,Title) > 0' RunSQL(lcSQL, oParams, 'myCursor') FUNCTION RunSQL LPARAMETERS tcSQL, toParams, tcOutCursor Select &tcSQL into cursor (tcOutCursor)Cetin