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

Monetary values in table

Status
Not open for further replies.

CleoMan

Programmer
Jun 18, 2003
110
ZA
I have somewhat of a stuped question so please be patient.

We have a table that acts as General ledger for accounting purposes. ONe of the columns is a total field that is calculated using a tax percentage and another price field from another table.

We created our General ledger table making the Total column of type Money, but know we find that the column can store up to six decimal places and we need it to be only 2 decimal places to avoid incorrect calculations for reporting purposes. (As it is now, we beleive the calculation results to be incorrect)

So how can we go about making the column a accurate representation of monetary values?

All and any help is greatly appreciated!!!
Richard
 
Richard,

You'll need two approaches:

1. Prevent more than two decimals from being entered as new values.

2. Round existing values to two decimals.

For the first, set the field object's Format property to an appropriate Number format, such as Windows $.

For the second, borrow some code from which covers accurate rounding in Paradox.

Hope this helps...

-- Lance
 
Once again thank you very much Lance, if all of this works correctly (and i'm sure it will) you just saved me hours of countless headaches.

Thanks
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top