Euricho,
I forgot the "set date british" at the start but I assume you have this set
up.

Dave Crozier


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Dave Crozier
Sent: 30 June 2008 13:57
To: 'ProFox Email List'
Subject: RE: Report values


Euricho,
This does what you want:

Create Cursor client (Id I, Date D, Value I)
Insert Into client Values (1, {01/01/2001}, 100)
Insert Into client Values (1, {02/01/2001}, 50)
Insert Into client Values (1, {03/01/2001}, 100)
Insert Into client Values (2, {01/01/2001}, 200)
Insert Into client Values (3, {15/01/2001}, 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


Dave Crozier

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Eurico Chagas Filho
Sent: 30 June 2008 13:17
To: 'ProFox Email List'
Subject: Report values


Hi

I have this;

Client    dtaMov   Value
  1       01/01/01  100
  1       02/01/01   50
  1       03/01/01  100
  2       01/01/01  200
  3       15/01/01  300

but I need to do something like this;

Client     dtaMov  Value
  1       01/01/01  100
  1       02/01/01  150
  1       03/01/01  250
  2       01/01/01  200
  3       15/01/01  300

The value must add the last value each cycle.

How can I do it ?

TIA, E.



[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://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