DB Grid: SOCORRO!!!!!

Delphi

28/10/2003

Como posso somar todos os números de uma coluna do DB Grid?


Coelhopirado

Coelhopirado

Curtidas 0

Respostas

Cbier

Cbier

28/10/2003

Use o seguinte:

Se o valor for mostrado em um edit, no evento on click de um button use o seguinte:

var
total:currency;
begin
total:=0;
table1.first;
while not table1.eof do
begin
total:=total + table1campo.value;
table1.next;
end;
Edit.text:=formatcurr(´#0.00´, total);
end;

Espero ter ajudado.

CBier


GOSTEI 0
POSTAR