Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Translate sqlserver to vfp command
Message
De
30/09/2005 06:17:36
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows Server 2003
Database:
Visual FoxPro
Divers
Thread ID:
01054718
Message ID:
01054804
Vues:
20
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform