Board index » delphi » Wrong amount by using then SQL SUM-Statement

Wrong amount by using then SQL SUM-Statement

It's strange!

I use Delphi 5.0 Prof. with BDE 5.1.1.

If I try to add 5 amounts of a numeric column (paradox-table) I miss 0,01.
It must be a error by rounding!
How can it happen?

The SQL-statement is

Select sum(<field>)
from <table>
group by <field>

Thanks for help

 

Re:Wrong amount by using then SQL SUM-Statement


The Numeric data type in Paradox tables is actually a floating point field.
Since binary floating point notation cannot represent most decimal fractions
exactly rounding errors can occur.

--
Bill Todd (TeamB)
(Questions received via email cannot be answered.)

Other Threads