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

Wrong Amounts

Status
Not open for further replies.

darnoc

Programmer
Dec 2, 2002
3
CA
I'm using CR9 to write a rate history report that will display the rate changes for a given bank.

The report should be as follows:

RateDate | NewRate | Increases

13-01-2001 5.75 -
01-02-2001 6.00 0.25
14-02-2001 6.00 0.0
21-03-2001 4.25 -1.75
...

The problem is that the calculated increases amount is usually wrong:

I'm using the formula below to calculate the increase.
What am I missing?

//GetIncreases
currencyvar cvIncreases;
WhilePrintingRecords;
cvIncreases := {NewRate} - Previous({NewRate});

Alternatively, I'd like to perform the calculate on the SQL server instead of relying on CR but now don't know if SQL has a previous record function eqivalent.
 
Try this formula instead:

If OnFirstRecord then 0 else {NewRate}-Previous({NewRate})

Also check your rounding as the math could be right and just appear to be wrong based on rounding.
Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top