Fazer While em Consulta

Delphi

19/02/2004

Olá pessoal,

Tenho em minha consulta asa seguintes informações:

Resposta_____Quant.
Regular______03
Bom_________05
Ótimo________03

Como faço para somar as quantidades e colocá-las em um Label usando o comando While?

Grato,

Ilano.


Ilanocf

Ilanocf

Curtidas 0

Respostas

Maicongabriel

Maicongabriel

19/02/2004

var
  iRegular, iBom, iOtimo : Integer;
begin
  while not {...} do
  begin
    iBom     := iBom + {...} ;
    iOtimo   := iOtimo + {...} ;
    iRegular := iRegular + {...} ;
  end;
  Label1.Caption := IntToStr(iBom);
  Label2.Caption := IntToStr(iOtimo);
  Label3.Caption := IntToStr(iRegular);
end;

Isso ? [i:c5ab6c036d]Isso é tudo, já que nenhuma outra informação foi passada...[/i:c5ab6c036d]


GOSTEI 0
Ilanocf

Ilanocf

19/02/2004

Na verdade, o q eu preciso é somar estes valores desta consulta, assim:

Resposta_____Quant. Regular______03 Bom_________05 Ótimo________03 [color=red:3700b6bdbe][b:3700b6bdbe]Total: 11[/b:3700b6bdbe][/color:3700b6bdbe]



GOSTEI 0
Ilanocf

Ilanocf

19/02/2004

:shock:


GOSTEI 0
POSTAR