Ver Mensaje Individual
  #5  
Antiguo 29-10-2007
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.572
Reputación: 27
egostar Va camino a la fama
Cita:
Empezado por douglas Ver Mensaje
perdon eduardocol, ya funciono, pero ahora el resultado que me da es cero, perdon tanta molestia e ignorancia de mi parte realize el siguiente codigo, y me muestra cero.

Código Delphi [-]
procedure TForm3.Button1Click(Sender: TObject);
var
a:integer;
b:string;
begin
    a:=0;
    query1.Close;
   query1.SQL.Clear;
   a:=a+query1.SQL.Add('select sum(monto)');
   query1.SQL.Add(' from ' + QuotedStr('control del internet'));
   query1.SQL.Add(' where fecha between :FechaIn and :FechaFin');
   query1.parambyname('FechaIn').Value:=edit1.text;
   query1.parambyname('FechaFin').Value:=edit2.text;
   query1.Open;
   showmessage(inttostr(a));
end;
A ver, porque no haces esto:

Código Delphi [-]
   a:=0;
   query1.Close;
   query1.SQL.Clear;
   query1.SQL.Add('select sum(monto)');
   query1.SQL.Add(' from ' + QuotedStr('control del internet'));
   query1.SQL.Add(' where fecha between :FechaIn and :FechaFin');
   query1.parambyname('FechaIn').Value:=edit1.text;
   query1.parambyname('FechaFin').Value:=edit2.text;
   query1.Open;
   a := query1.fields[0].AsInteger;   
   query1.Close;
   showmessage(inttostr(a));

Salud OS
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita