Balance brought forward (1 Viewer)

Groundrush

Registered User.
Local time
Today, 14:09
Joined
Apr 14, 2002
Messages
1,376
I am trying to keep a running total of money left over after paying money out.
What is the best way to carry the balance over ?

I have a Debit and Credit field and in my query I have typed in Balance:[Credit]-[Debit], which works for the first record
but give a negative value for the rest.

any ideas?

:confused: Thanks
 

Groundrush

Registered User.
Local time
Today, 14:09
Joined
Apr 14, 2002
Messages
1,376
I suppose I should use the Help function in Access more often

I have solved my query by using a running sum...

:D yeepeeeeeee
 

Jon K

Registered User.
Local time
Today, 14:09
Joined
May 22, 2002
Messages
2,209
Could you post the query code you are using?

I have been looking for ways of producing running totals in SELECT queries.

What version of Access are you using? When I look up 'running sum' in Access's help, I can find only running sums in reports, not in queries. I am using Access 97.

Thanks
 

Groundrush

Registered User.
Local time
Today, 14:09
Joined
Apr 14, 2002
Messages
1,376
It looks like you can only use the Running sums on a report

I am using Access 2000 and still looking for a solution to the same problem as you.

trying to keep running totals in the Form and query

:( Regards
 
R

Rich

Guest
Why would you want to do running totals in a query? It's probably the worst place to put one.
 

Jon K

Registered User.
Local time
Today, 14:09
Joined
May 22, 2002
Messages
2,209
I see what you mean. But I have to export data to a predefined range in an Excel worksheet held by another department. To do this,I have to use INSERT INTO.

For now, I can only use code or a report to calculate the running total before exporting.

I think it will be much neater if I can do it in the INSERT INTO query.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:09
Joined
Feb 19, 2002
Messages
43,445
It is MUCH better to create the running sum in the spreadsheet. The usual way to create running sums in a query is by using a DSum() function. To use this method your query needs to include the UNIQUE identifier from the base table. For EVERY row in the recordset a separate query must be run to sum all the previous (by key value) rows. A running sum done in a report or spreadsheet is a simple sequential process and is based on physical row order rather than key values.
 

Users who are viewing this thread

Top Bottom