Query calculation problem

smallWorld

Registered User.
Local time
Tomorrow, 05:12
Joined
Jan 10, 2008
Messages
15
Hi to all,

In my report, there is a calculated column called Cost that display as $13.13. The orginal value is 13.125. This column is used to calculate another field called leftover.

The expected result is $16.00 - $13.13 = $2.87
The actual result is $16.00 - $13.125 = $2.88. So there is a increase of $0.01.

The results in my report is run using a query. In the query, I set the format of the calculated field, Cost as $#,##0.00;($#,##0.00). How can I ensure that whatever it calculate is what's displayed? Meaning to say if it display 13.13, use it instead of using 13.125 to calculate the leftover value.

Thx!
 
Format is just that; a format. It doesn't affect the underlying value. Wrap your calculation in the Round function to round the value as desired.
 
Thanks for your reply!
 
the problem is probably storing an amount of 13.125 in the first place. why dont you round that off originally?

either int(amount+100)/100 will truncate

or clng(amount*100)/100 will round i think
 

Users who are viewing this thread

Back
Top Bottom