Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL how to
Message
From
15/02/2003 21:29:57
 
 
To
15/02/2003 20:23:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00753795
Message ID:
00753802
Views:
19
Try with something like this:
lnAmount = $0.00
SELECT recno() AS nRecord, Amount , RunBal(@lnAmount,Amount) +$0.00 AS RunBal

FUNCTION RunBal
LPARAMETERS tnTotalAmount, tnCurAmount

tnTotalAmount = tnTotalAmount + tnCurAmount

RETURN (tnTotalAmount)
I didn't probe this (no VFP near ). Try & Told us how was it.


>Hi,

>I am displaying a table in a grid, but i would like a calculated field to also be displayed. For example, the table has a column called Amount, I would like a new column called Running Balance recalculating the previous running balance plus current amount for the new running balance...
>RECNO   AMOUNT   RUNBAL
1         1.00     1.00
2         2.00     3.00
3         3.00     6.00
>...I am having problems coming up with an SQL for the above( select amount,?????? as runbal from table into cursor). I hope someone can help.
Apoya a Visual FoxPro usandolo legalmente
--
¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º
Espartaco Palma Martínez
SysOp PortalFox
http://www.portalfox.com
esparta@portalfox.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform