Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Balance

Status
Not open for further replies.

SebaPerez

Programmer
Feb 11, 2004
9
FR
I have got another problem. I need to make a report concerning a balance. I am using CR8.5 with Access

The layout would be like the following:

Commitment 13.000 (@commitment)
Expenditure 1 1.000 12.000 (@ balance)
Expenditure 2 500 11.500
Expenditure 3 1.200 10.300
______________________________
TOTAL 10.300

I have a group by Class that groups all the commitment and Expenditure that matches together. How can I make the @balance to work as the example (calculating with the previous data). I tried to use the function previous but CR won't allow me to use it.

Thanks

Sebastian

 
Please provide the formula for {@commitment}. Also tell use whether expenditures are a database field or whether they are summaries.

-LB
 
The formula for the @commitment is :
if {wpo_oc_1.LEDGER} = &quot;CC_BUDGET&quot; and {wpo_oc_1.CLASS_FLD} <> &quot;&quot; then {wpo_oc_1.POSTED_BASE_AMT}

The expenditures are database fields. It would be like I have lines of transactions (some of them are expenditure, others are commitments). The idea is that I summarize all the commitments and then match some expenditures for that commitment (like in the example). Each expenditure that matches with the commitment makes decrease the amount of the commitment.

Please tell me so, if you need more information.

Thanks

Sebastian
 
This is confusing:

&quot;The idea is that I summarize all the commitments and then match some expenditures for that commitment (like in the example)&quot;--are you saying that the &quot;13000&quot; in your example is a summary of {@commitment} like sum({@commitment})? Or is it just the formula {@commitment}, unsummarized?

-LB
 
Yes sorry. The @commitment that appears on my layout is wrong: It is an Summary of @commitment.

Now, for each expenditure that I have (which matches with that total commitment) I have to do what I asked in my 1st. post.

Sorry for the confusing post, but as I am a beginner it is also difficult to explain it.

Sebastian
 
You can try creating two formulas:

//{@reset} to be placed in the group (class) header:
whileprintingrecords;
numbervar initbal := 0;
numbervar newbal := 0;

//{@balance} to be placed in the detail section:
whileprintingrecords;
numbervar initbal := sum({@Commitment}, {table.class});
numbervar newbal := newbal - {table.expenditure};
initbal + newbal;

This should work as long as you don't have duplicate expenditures because of table joins.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top