Anyone had this problem (and a fix :) ):
MS Access database, via the BDE (5.01). Invoice item table,
has a currency field for the amount. Amounts range from a few dollars
(and cents) to a few thousand. I need to sum them up. This works:
select sum(amount) as total from invoiceLine
calc's it just fine.
BUT, I need to add lines, which are uncommitted, and provide a sum of
that
also. This DOES NOT work:
total := 0;
while not tblInvoice.eof do begin
total := total + tblInvoice.FieldByName("amount").AsCurrency;
end;
It has a habit of screwing with the post-decimal value, ie:
75.6100 becomes 75.6099
accumulate that over a few hundred or thousand records and, well, its a
BIG problem, especially in a financial-type app!!!
Anyone know of a way to get accurate values out of the BDE?? I've had to
create a temp table and doa cross-table sum, but I'd much rather do this
in code.....
HELP! :)
Nic.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz