Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening Balance
Message
From
16/06/2008 19:35:50
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
16/06/2008 12:34:30
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01324211
Message ID:
01324601
Views:
13
>Dear Bhavbhuti Nathwani
>
>No body wrote any code in this thread. Every body try to present suggestions.
>I ask if thread poster knows the codes then what he needs to post any thread.

It's easy to write the code - it's much harder to design the tables (or even temporary cursors) to have as little code as really necessary.

There are several things to consider in your case (and yes, I had my running totals to do in my time). First, can you trust the totals column? Is it possible that a record may come somewhere in the middle and you'd have to recalculate everything from that point on? Is it possible that a record may be deleted (and then recalculate everything again)? Also, are you sure the records will always show in this order? If there's any chance that they may show in a different order, then you'd have to recalculate for the new order.

If it will always be by date, and there is one and only one record per date, then it's simple:
lnTotal=0
lnOpening=0
scan
   lnTotal=lnTotal+receipt-payment
   replace opening with lnOpening;
      ,   total with lnTotal
   lnOpening=lnTotal
endscan
If any record changes (add new, change existing, delete... anything), you would need to run this again.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform