Query where field is on the last record (1 Viewer)

swarv

Registered User.
Local time
Today, 22:55
Joined
Dec 2, 2008
Messages
196
Hi all,

I have a table with fields like: totalmanaged and ID.
Now when the user clicks on the next record I would like a field to calculate the difference between the figure in totalmanaged on the ID before and the value in totalmanaged in the current ID.

Is this possible?

Thanks

Martin
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 22:55
Joined
Jul 9, 2003
Messages
16,369
Yes, I think you want to search the forum for "running sum" and try and find Roger's access website, he's got loads of examples and one specifically for this I recall.
 

swarv

Registered User.
Local time
Today, 22:55
Joined
Dec 2, 2008
Messages
196
Cheers uncle,
I couldn't find his posts.
I so far have this which works for the total:
Code:
SELECT Sum(tbldebt.totalmanaged) AS AllTotal, nameid2 as FullName
FROM tbldebt
GROUP BY tbldebt.nameid2;

But I would like to pick this record and then subtract the previous record's amount. The amounts are stored in totalmanaged field.

Is this possible?

Thanks

Martin
 

Users who are viewing this thread

Top Bottom