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

SUM NOT ROUNDING BEFORE ADDING

Status
Not open for further replies.

gearhead03

Technical User
Mar 29, 2003
147
US
I HAVE A REPORT THAT IS DESIGNED TO SHOW A LIST OF OUTSTANDING INVOICES, INCLUDING THE AMOUNT OWED TO ME. I AM USING THE SUM FUNCTION TO GET A TOTAL FOR EACH CUSTOMER AND A GRAND TOTAL. THE FIELD NAME FOR THE AMOUNT OWED TO ME IS "GROSS". THE SYNTAX IN BOTH THE GROUP AND THE REPORT FOOTERS IS =SUM([GROSS]). GROSS IS A CALCULATED CONTROL. THE CALCULATION IS DONE IN THE QUERY FOR THIS REPORT. THIS IS WORKING GREAT WITH ONE EXCEPTION. I HAVE ONE CUSTOMER THAT WE CHARGE BASED ON SOME HALF CENT RATES (IE: 501 PIECES @ 1.355 PER PIECE = $678.855. WHEN I PRINT AN INVOICE IT PRINTS AS $678.86.WHICH IS CORRECT. WHEN I PRINT THIS REPORT IT SUMS THE TOTAL THEN ROUNDS IT. THIS RESULTS IN MY PRINTED INVOICES TOTALING MORE THAN MY REPORT TOTAL. EACH LINE WILL SHOW THE CORRECT CHARGE $678.86. BUT THE TOTAL IS OFF.
EXAMPLE: ACTUAL AMOUNT:
100.56 100.555
250.36 250.355
687.86 687.855
150.25 150.250
149.36 149.360
469.75 469.750
TOTAL:1808.125 PRINTED INVOICE TOTAL:1808.14
I HAVE TRIED CHANGING THE FORMAT TO CURRENCY IN EVERY PLACE AND 2 DECIMAL PLACES. IT DOESN'T MAKE ANY DIFFERENCE.
 
try instead of =SUM([GROSS]), =Sum (Round([GROSS],2))

This will round it before it is summed, so the half cents are rounded up before being added.

ChaZ

Ascii dumb question, get a dumb Ansi
 
I can't get that line to work in my report. it says undefined function round. any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top