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

v8.5-Totals not coming out correctly

Status
Not open for further replies.

markajem

Programmer
Dec 20, 2001
564
US



v8.5
MS-SQL2000

I have a basic report. Not using the report header section. No grouping. Have 3 files linked together using a common key to all three files.

2 files are from one database on one server and 1 file is a view from another database on another server. This does not seem to be the issue but wanted to mention it. We have done this before.

No subreports either.

What my problem is while the report prints fine some of my sum totals are not correct. What I would like to mention is the view when linked to one of the other files does result back with nulls. I compensate in the formula for this with an isnull(field). I am starting to think that this is my problem. If I do a RunningTotal, whileprinting with the variable or just an insert subtotal all these values are the same but when I do the calculations manually against the column totals they are wrong. Another thing I noticed is that one of the columns that has a calculation with a null that columns total is incorrect.

Any ideas as to what may be causing this?

Thanks



 
You may want to try creating a variable to use as a running total. Since you have no grouping, you will not need to zero out the variable. So you will need only two formulas. In the details section:

Code:
WhilePrintingRecords;
Global NumberVar RunningTotal;
If not IsNull({Table.Field}) then
RunningTotal := RunningTotal + {Table.Field};

And in your report footer:
Code:
WhilePrintingRecords;
Global NumberVar RunningTotal;
RunningTotal;
 


DK87 - Nope, I already tried that method before posting. It did not work. I have a strong feeling it is because of the NULLs that is causing this problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top