I immediately apologize if this is the incorrect forum to post this thread.
I use Delphi6 on MS-Windows(Prof) in which I have the procedure below.
Even if the SUM of BALANCE, being the total of PLUS and MINUS values, amounts to '0'
TOTAL_ERROR does not see this as being '0' at LINE A in the procedure.
if dmStdAcc.PivotTbl1KeyOrigin.value = 'GL' then // Trial Balance is peculiar to the GL
begin // AND not a manual T/B
qryname1 := '''C:\h\StdAcc\' + IntToStr(dmStdAcc.PivotTbl1PNo.AsInteger) + '\GL'' t1, ''C:\h\StdAcc\PivotTbl1'' t2';
qryname2 := ('(t1.PNo = t2.PNo) AND(t1.PDate >= t2.AltStartDate) AND (t1.PDate <= t2.AsAtDate)');
with dmStdAcc.qryGLTBLeft do
begin
SQL.Clear;
SQL.Add('SELECT SUM (LBal)TOTAL_LEFT');
s:=format('FROM %s',[qryname1]);
SQL.Add (s);
s:=format('WHERE %s',[qryname2]);
SQL.Add (s);
Active := True;
dbtxFLBal.DataSource := dmStdAcc.dtsGLTBLeft;
end;
with dmStdAcc.qryGLTBRght do
begin
SQL.Clear;
SQL.Add('SELECT SUM (RBal)TOTAL_RIGHT');
s:=format('FROM %s',[qryname1]);
SQL.Add (s);
s:=format('WHERE %s',[qryname2]);
SQL.Add (s);
Active := True;
dbtxRBaL.DataSource := dmStdAcc.dtsGLTBRght;
end;
with dmStdAcc.qryGLTBError 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;
txtFTBError.DataSource := dmStdAcc.dtsGLTBError;
[highlight #EDD400]LINE A[/highlight] if dmStdAcc.qryGLTBError.FieldByName('TOTAL_ERROR').Value <> 0 then
Click;
Old Man Delphi
I use Delphi6 on MS-Windows(Prof) in which I have the procedure below.
Even if the SUM of BALANCE, being the total of PLUS and MINUS values, amounts to '0'
TOTAL_ERROR does not see this as being '0' at LINE A in the procedure.
if dmStdAcc.PivotTbl1KeyOrigin.value = 'GL' then // Trial Balance is peculiar to the GL
begin // AND not a manual T/B
qryname1 := '''C:\h\StdAcc\' + IntToStr(dmStdAcc.PivotTbl1PNo.AsInteger) + '\GL'' t1, ''C:\h\StdAcc\PivotTbl1'' t2';
qryname2 := ('(t1.PNo = t2.PNo) AND(t1.PDate >= t2.AltStartDate) AND (t1.PDate <= t2.AsAtDate)');
with dmStdAcc.qryGLTBLeft do
begin
SQL.Clear;
SQL.Add('SELECT SUM (LBal)TOTAL_LEFT');
s:=format('FROM %s',[qryname1]);
SQL.Add (s);
s:=format('WHERE %s',[qryname2]);
SQL.Add (s);
Active := True;
dbtxFLBal.DataSource := dmStdAcc.dtsGLTBLeft;
end;
with dmStdAcc.qryGLTBRght do
begin
SQL.Clear;
SQL.Add('SELECT SUM (RBal)TOTAL_RIGHT');
s:=format('FROM %s',[qryname1]);
SQL.Add (s);
s:=format('WHERE %s',[qryname2]);
SQL.Add (s);
Active := True;
dbtxRBaL.DataSource := dmStdAcc.dtsGLTBRght;
end;
with dmStdAcc.qryGLTBError 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;
txtFTBError.DataSource := dmStdAcc.dtsGLTBError;
[highlight #EDD400]LINE A[/highlight] if dmStdAcc.qryGLTBError.FieldByName('TOTAL_ERROR').Value <> 0 then
Click;
Old Man Delphi