Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid total running amount
Message
From
02/07/2008 03:06:35
 
 
To
02/07/2008 00:47:28
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01328170
Message ID:
01328178
Views:
8
>How do I run a running total in column amount of my grid?

You can get a running-totals column by doing a self-join:
CREATE CURSOR temp (idField Int, amount Num(15,2))
INSERT INTO temp VALUES (1, 11.3)
INSERT INTO temp VALUES (2, 8.7)
INSERT INTO temp VALUES (3, 10)

SELECT T1.idField, T1.amount, SUM(T2.amount) ;
    FROM temp T1 ;
        JOIN temp T2 ON T2.idField <= T1.idField ;
    GROUP BY 1, 2 ORDER BY 1
hth
-Stefan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform