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

Rounding problem in calculated field

Status
Not open for further replies.

rgw

Technical User
Sep 14, 2000
70
US
I am rewriting a routine for showing the user information on transactions which result in the creation of a check. I have a sql select statement which shows the individual transactions with a calculated column which shows the amount of the check which may be made up of many individual transaction lines. My problem lies in the rounding of the calculated field. Instead of showing say $1,245.05 which may be made up of 4 transactions the grid shows $1,245.10 so some rounding seems to be going on (if i change it to $1,245.04) I get $1,245.00).

A straightforward sql clause with a grouping on the customer gives the right answer but I would rather show both the detail and the total in one grid.

many thanks
rgw



 
A few things could be occuring.

1. Make sure your set decimals is large enough.

SET DECIMAL TO 10

2. Make sure the field does not have an input mask or format that could be pimping you.

3. If the field has a control source and it is tied to a field on a table, make sure the field on the table has enough decimals to hold the results.

Jim Osieczonek
Delta Business Group, LLC
 
The SQL itself can clip your return. Try adding 0000000.00 to the sum e.g.

sele sum(x)+0000000.00 to x

adjust size as needed.

Brian
 
Jim

Seems that the underlying field wasn't wide enough in this cirucumstance. Worked absolutely fine for everything else but increasing its size by one seems to have worked.
many thanks
rgw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top