# Crystal report Cumulative balance

i am trying to do a cumulative balance:
i need to be abel to add the balance to the sum of the previous section
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Professor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Use a formula (in the section where the previous balance) is established to declare a numeric variable and set its value to that balance.  For example:
``````Global NumberVar RunningBalance := Sum(...)
``````
In later sections, use another formula to declare the same variable and add to it the additional balances. For example:
``````Global NumberVar RunningBalance;
RunningBalance := RunningBalance + {Payment}
``````
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
If the report can have more than 2 groups, do you want the total from _only_ the group right before that one, or do you really want the total of all of the groups (records) up to that point?

If you want the total for everything up to that point, a running total may be all that you need.

James
0
Author Commented:
the total that i got in the second section was not right
0
Author Commented:
James0628 the report has 1 group which is group by date
0
Professor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Tough to guess what is wrong without more detail.
Explain what formula you have in what section and at what point you get a value that is not as expected.
Use images if possible.
0
Author Commented:
so that is the way the report is designed 1 group by date
the point of this report is to show in the first section the sum of the payment from the begging of time till the day the user choose and in the second section the payments done from the day desired till present day
the first section will only show the sum and the second section will show the details as well as the details
the trick is that i need the total of the first section to be used in the difference of payments as your code did but the sum displayed in the function isn't the sum of the first section
0
Commented:
the point of this report is to show in the first section the sum of the payment from the begging of time till the day the user choose and in the second section the payments done from the day desired till present day
Define "first section" and "second section".

the first section will only show the sum and the second section will show the details as well as the details
"... will show the details as well as the details" ?

James
0
Author Commented:
Show the details as well as the Total** sorry for the mistake
anw i found an alternate solution using the running total in the query
0
Commented:
So you've got the figures that you were looking for?  Glad to hear it.

James
1
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.