Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Translate sqlserver to vfp command
Message
From
30/09/2005 06:17:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
29/09/2005 19:05:04
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows Server 2003
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01054718
Message ID:
01054804
Views:
19
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform