Cita:
Empezado por kurono
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.