Smart questions
Smart people
 Find A ForumFind An Expert
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Remember Me

Are you a
Computer / IT professional?
Join Tek-Tips now!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Just copy and paste the

Feedback

"...I have been a grateful member of this site for several years. I love this site and refer everyone to it!..."

Geography

Where in the world do Tek-Tips members come from?

Report Calculations

 Forum Search FAQs Links Jobs Whitepapers MVPs
 foxinphilly (MIS) 27 Jan 11 9:14
 I am working in a report and grouping by date.This sounds really dumb but if I calculate a sum to a date, in this case two parameters: bundles and hours.  I obviously obtain two totals.  If I create two variables (bund_tot and hour_tot)to obtain the same totals, they match.  In this case, 3 records total bundles to 552 and hours to 6.48.  But if I use the variables and divide bund_tot by hour_tot the result is incorrect!  The report shows 85.14 but the real total is 85.19.  Do I need to pre-calculate the totals before I run the report?  Why even have totals if the numbers don't work????  Any ideas would be helpful.
 philthoms (Programmer) 27 Jan 11 9:45
 I have also had a similar problem to this a long time ago.I think I used the SET DECIMALS to 2 command and made sure the fields in the report were stretched to cover 2 decimal places.It may sound odd but this cured the problem as I remember.
 foxinphilly (MIS) 27 Jan 11 9:52
 Thanks but that doesn't help.  I think I'll just have to run this report from a query rather than a table.
 MrDataGuy (Programmer) 27 Jan 11 14:56
 My 2 cents.Other then some very simple column totals I (almost) always do the needed calculations in fox code in a temp table/query before passing it on to the report to print.  I guess I like to see the data in a brower while developing etc. before sending it to a printer.  Besides then I can send the data to EXCEL, HTML etc etc if the user needs it. Lion Crest Software ServicesAnthony L. TestiPresidentwww.LionCrestSoftwareServices.com
 cricket (TechnicalUser) 31 Jan 11 5:46
 Show us the 3 records (bundles and hours for each record)Also show the incorrect report output for bundles/hr and what you consider to be the correct answer
 foxinphilly (MIS) 31 Jan 11 14:40
 What I finally did was to allow the report to sum the total to a variable.  I then took that variable and made it into a string and then back to a value.  val(str(variable,10,2))   this made the numbers consistent.thanks for all your suggestions.
 cricket (TechnicalUser) 3 Feb 11 18:58
 You can't trust your workaroundSupply the values for the 3 records as I requested
 dbMark (Programmer) 4 Feb 11 16:53
 Cricket is right, without seeing the numbers, we can only guess at the actual issue and any suggested solutions would be guesses too.  My guess us that by using VAL(STR(variable,10,2)) you are in effect rounding the numbers.  Apparently one method is rounding (or truncating) and the other method isn't.

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!