I use Delphi6 Professional.
I have a [Paradox] table in which plus and minus values are put into a particular field 'Balance' in each record of the table. At all times the plusses and minusses should equal one another - leaving the SUM of 'Balance' to be "0". If it does not there is an error which the code below detects and triggers an alert with a Click Procedure.
This works perfectly in one table - but in ANOTHER identical unrelated table [USED ELSEWHERE] where in fact Balance correctly reflects as being "0" [in Delphi DataBaseDesktop] - a break-point at LINE A in the code below reflects Balance to be[obscure] "=1.182234e-17"; and the alert is falsely triggered.
Any ideas as to why?
Thanks in advance!
Old Man Delphi
I have a [Paradox] table in which plus and minus values are put into a particular field 'Balance' in each record of the table. At all times the plusses and minusses should equal one another - leaving the SUM of 'Balance' to be "0". If it does not there is an error which the code below detects and triggers an alert with a Click Procedure.
This works perfectly in one table - but in ANOTHER identical unrelated table [USED ELSEWHERE] where in fact Balance correctly reflects as being "0" [in Delphi DataBaseDesktop] - a break-point at LINE A in the code below reflects Balance to be[obscure] "=1.182234e-17"; and the alert is falsely triggered.
Any ideas as to why?
Code:
with dmStdAcc.qryDLTBError do
begin
SQL.Clear;
SQL.Add('SELECT SUM (Balance)TOTAL_ERROR');
s:=format('FROM %s',[qryname1]);
SQL.Add (s);
s:=format('WHERE %s',[qryname2]);
SQL.Add (s);
Active := True;
end;
if dmStdAcc.qryDLTBError.FieldByName('TOTAL_ERROR').Value <> 0 then // LINE A
Click;
Thanks in advance!
Old Man Delphi