I have an ADOQuery populating a DBGrid. I'm trying to do
for n := 0 to qry1.RecordCount-1 //200 records
begin
Total := Total + qry1.FieldValues['TAX'];
Next;
end;
This simply adds the first record in the query 200 times!
Could someone pse tell me what I'm doing wrong?
Also, if I don't want to sum using qry1, how could I add the values in column 5 (200 rows) of the DBGrid?
Hannes
for n := 0 to qry1.RecordCount-1 //200 records
begin
Total := Total + qry1.FieldValues['TAX'];
Next;
end;
This simply adds the first record in the query 200 times!
Could someone pse tell me what I'm doing wrong?
Also, if I don't want to sum using qry1, how could I add the values in column 5 (200 rows) of the DBGrid?
Hannes