Ver Mensaje Individual
  #16  
Antiguo 15-11-2011
Avatar de olbeup
olbeup olbeup is offline
Miembro
 
Registrado: jul 2005
Ubicación: Santiago de la Ribera (España)
Posts: 685
Reputación: 19
olbeup Va camino a la fama
Cita:
Empezado por kurono Ver Mensaje
amigo lo resolvi agregandole parametro aqui el codigo

Código Delphi [-]
begin
 with Enlace.Consulta_Registro do
    begin
           Close;
           SQL.Clear;
           SQL.Add('Select sum(Deposito) from Depositos_Retiros where Nombre='+txt_nombre.Text+' and Apellido ='+ txt_apellido.Text);
           Parameters.ParamByName(txt_nombre.Text).Value:=txt_nombre.Text;
           Parameters.ParamByName(txt_apellido.Text).Value:=txt_apellido.Text;
          open;
       end;
end;


muchas gracias por la ayuda
Son mas líneas pero es más claro y sin parametros
Código Delphi [-]
with Enlace.Consulta_Registro do
begin
  Close;

  SQL.Clear
  SQL.Add('SELECT');
  SQL.Add('    SUM(DEPOSITO) AS TOTALDEPOSITO');
  SQL.Add('  FROM Depositos_Retiros');
  SQL.Add('  WHERE NOMBRE = ' + QuotedStr(txt_nombre.Text));
  SQL.Add('        AND APELLIDO = ' + QuotedStr(txt_apellido.Text));

  Open;
end;
Un saludo.
Responder Con Cita