Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 15-11-2011
amell2020 amell2020 is offline
Miembro
NULL
 
Registrado: feb 2011
Posts: 41
Poder: 0
amell2020 Va por buen camino
'SELECT sum(Deposito ) from Depositos_retiros WHERE NOMBRE='TXT_APELLIDO.TEXT' AND APELLIDO = 'TXT_APELLIDO.TEXT';
prueba ese haber
Responder Con Cita
  #2  
Antiguo 15-11-2011
Avatar de kurono
[kurono] kurono is offline
Miembro Premium
 
Registrado: jul 2007
Ubicación: Republica Dominicana
Posts: 1.144
Poder: 21
kurono Va por buen camino
con ese no me compila y el error que da es txt_nombre.text no de fondo
Responder Con Cita
  #3  
Antiguo 15-11-2011
amell2020 amell2020 is offline
Miembro
NULL
 
Registrado: feb 2011
Posts: 41
Poder: 0
amell2020 Va por buen camino
query.sql.add('Select sum(Deposito) from Depositos_Retiros where Nombre = 'txt_nombre.text' and Apellido = 'txt_apellido.text'
mira con este
Responder Con Cita
  #4  
Antiguo 15-11-2011
Avatar de kurono
[kurono] kurono is offline
Miembro Premium
 
Registrado: jul 2007
Ubicación: Republica Dominicana
Posts: 1.144
Poder: 21
kurono Va por buen camino
amigo amell2020 ese es el mismo codigo que el de arriba osea el antepenultimo de este
Responder Con Cita
  #5  
Antiguo 15-11-2011
amell2020 amell2020 is offline
Miembro
NULL
 
Registrado: feb 2011
Posts: 41
Poder: 0
amell2020 Va por buen camino
si y no te funciona, puede mostrarlo una imagen de tu error? asi veremos mejor lo que explicas
Responder Con Cita
  #6  
Antiguo 15-11-2011
Avatar de kurono
[kurono] kurono is offline
Miembro Premium
 
Registrado: jul 2007
Ubicación: Republica Dominicana
Posts: 1.144
Poder: 21
kurono Va por buen camino
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
Responder Con Cita
  #7  
Antiguo 15-11-2011
Avatar de olbeup
olbeup olbeup is offline
Miembro
 
Registrado: jul 2005
Ubicación: Santiago de la Ribera (España)
Posts: 688
Poder: 22
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
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Consulta delphi llopez88 Varios 6 03-11-2011 10:24:25
consulta en Delphi corvarod OOP 2 09-03-2009 22:28:22
Consulta SQL+DELPHI 7 Gbyte SQL 8 28-07-2008 10:28:42
Consulta Delphi 6, Delphi 2005 y Delphi 2006 Leviatan Varios 6 18-08-2007 16:02:08
Consulta con delphi zvf OOP 11 27-07-2006 00:57:49


La franja horaria es GMT +2. Ahora son las 02:38:34.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi