Is this what you mean?

Create Cursor client (Id I, Date D, Value I)
Insert Into client Values (1, {^2001-01-01}, 100)
Insert Into client Values (1, {^2001-01-02}, 50)
Insert Into client Values (1, {^2001-01-03}, 100)
Insert Into client Values (2, {^2001-01-01}, 200)
Insert Into client Values (3, {^2001-01-15}, 300)

Select ;
        C1.id, ;
        C1.Date, ;
        C1.Value, ;
        sum(C2.Value) as balance;
from Client C1 ;
join Client C2 on C1.id=C2.id ; 
        and C1.date>=C2.date ; 
group by C1.Id, C1.Date, c1.value

Dave

-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Laurie Alvey
Sent: 30 January 2015 10:47
To: ProFox Email List
Subject: Running totals (without doing a SCAN)

Does anyone know a way of calculating a running total column without using 
SCAN, i.e. some form of UPDATE <table> SET... etc? I can do it in SQL Server 
but I would like to do it in VFP.

Laurie


--- StripMime Report -- processed MIME parts --- multipart/alternative
  text/plain (text body -- kept)
  text/html
---

[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to