>i want to translate the followng command fo sql server to vfp
>
>SELECT @ing_fon =SUM(mont2)FROM PLPLFMOV AS MOV JOIN PLPLFTAB AS TAB
>ON mov.concep = tab.concep
>WHERE cod_emple = '092754' AND LEFT(MOV.CONCEP,1)='1' AND SUBSTRING(tab.tab_dscto,1,1) = 'F'
>
>how can i do this
>thank you
Luis,
VFP doesn't assign single value SQL results to a predefined variable except to an array.
VFP needs semicolon as command line continuation separator.
local array aResult[1]
local ing_fon
SELECT SUM(mont2) FROM PLPLFMOV AS MOV JOIN PLPLFTAB AS TB ;
ON mov.concep = tb.concep ;
WHERE cod_emple == '092754' AND LEFT(MOV.CONCEP,1)='1' AND SUBSTRING(tb.tab_dscto,1,1) = 'F' ;
into array aResult
ing_fon = iif(_Tally > 0 and !isnull(aResult),aResult,0)
SELECT SUM(mont2) as ing_fon ... into cursor myCursor
would create a cursor naming sum column ing_fon.
Cetin