Showing Infinity value in table

R

Ram Palav

In msaccess 2000 i have a table that contains 5 fields
code,opening,debit,credit,closing

now, when i go to update field closing by writing query

"UPDATE TABLE SET CLOSING=OPENING+DEBIT-CREDIT"

In few records it shows values like
Opening, debit, credit, closing
0, 426.987, 426.987, 0.00000023232326

if i use round function in the same query
"UPDATE TABLE SET CLOSING=round(OPENING+DEBIT-CREDIT,3)"
it gives me correct values.

However if i write the same query from visual basic
it gives me error undefined function.


can any help me.
 
J

John Vinson

In few records it shows values like
Opening, debit, credit, closing
0, 426.987, 426.987, 0.00000023232326

It would appear that you have defined these fields as Double or Float.
These number types allow fractions, but are APPROXIMATIONS - just as
1/7 cannot be depicted exactly as a decimal fraction, 0.001 cannot be
depicted exactly as a Float.

If you need no more than four decimal places I would suggest that you
change the datatype of these fields to Currency (the currency
*datatype*, which is independent of the currency *format*) instead of
any kind of Number. A Currency field is a gigantic scaled integer with
exactly four (no more, no fewer) decimal places and NO roundoff error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top