Ver Mensaje Individual
  #2  
Antiguo 28-07-2008
Avatar de ContraVeneno
ContraVeneno ContraVeneno is offline
Miembro
 
Registrado: may 2005
Ubicación: Torreón, México
Posts: 4.738
Reputación: 23
ContraVeneno Va por buen camino
¿por qué no lo haces en una sola consulta?

Código Delphi [-]
with adoquery1 do begin
 If active then close; 
 SQL.Clear;
 SQL.Add('select sum(ganancia) as ganancia, sum(capital) as capital, sum(imp) as imp from diario');
 SQL.Add('where fecha between :Fechain and :Fechafin');
 Parameters.ParamByName('Fechain').Value:=datetimepicker1.DateTime;
 Parameters.ParamByName('Fechafin').Value:=datetimepicker2.DateTime;
 Open;
 edtGanacia.Text:=floattostr(FieldByName('Ganacia').AsFloat);
 //edtganacia.Text := FieldByname('Ganacia').AsString;
 edtCapital.Text:=floattostr(FieldByName('Capital').AsFloat);
 edtImp.Text:=floattostr(FieldByName('Imp').AsFloat);
 Close;
end; //with
__________________

Responder Con Cita