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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Formula

Status
Not open for further replies.

rpal

Programmer
Jun 16, 2003
37
US
I have formula called @EndingBalance.
@EndingBalance={@Begin Balance}+Sum ({GLTRANS.BASE_AMOUNT}, {GLTRANS.ACCOUNT})
If I am placing @EndingBalance formula in AccountGroup Footer section I am getting bignumber than I should. But
if I place same @EndingBalance formula in the AccountGroup Header section I am getting correct number. I did not understand what make diffrence in the Header and Footer.

-Rpal
 
Hello synapsevampire,
Following is the {@Begin Balance} formula:

if datepart("m",{GLTRANS.POSTING_DATE})=1 then
{GLTRANS.BASE_AMOUNT}
ELSE
if datepart("m",{GLTRANS.POSTING_DATE})=2 then
({GLAMOUNTS.DB_BEG_BAL}+{GLAMOUNTS.DB_AMOUNT_01})+
({GLAMOUNTS.CR_BEG_BAL}+{GLAMOUNTS.CR_AMOUNT_01})
else
if datepart("m",{GLTRANS.POSTING_DATE})=3 then
({GLAMOUNTS.DB_BEG_BAL}+{GLAMOUNTS.DB_AMOUNT_01}+{GLAMOUNTS.DB_AMOUNT_02})
+
({GLAMOUNTS.CR_BEG_BAL}+{GLAMOUNTS.CR_AMOUNT_01}+{GLAMOUNTS.CR_AMOUNT_02})

 
well...the Sum will calculate the same no matter where it is because it is done before the records are printed

The other part - {@Begin Balance} - uses different data when in the Header than in the Footer.

In the header it uses the first record for the AccountGroup and in the footer it uses the last record.

It seems you want the first record data for some reason.

Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top