Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query with a running total
Message
From
13/12/2006 11:27:26
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01137566
Message ID:
01177215
Views:
9
SELECT Date, Debit, Credit,;
       NVL(SELECT SUM(Credit-Debit) FROM MyTable Tbl1 WHERE Tbl1.Date < MyTable.Date), CAST(0 AS N(12,2)) AS Balance;
       FROM MyTable
Hi,

I refer to my earlier thread of wanting a running balance for debit and credit fields. I thank Borislav for the code he sent to me . However,the code works well if the running balance is for a particular date. But if there are many entries for a single date, all the running totals for a particular date period remain the same, even though the individual values of debit and credit are different. I would like to know how to get a running total based on the record number, and not the date.

Thanks,



Regards,

Steve.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform