Ver Mensaje Individual
  #14  
Antiguo 07-09-2012
JairoC JairoC is offline
Miembro
NULL
 
Registrado: oct 2011
Posts: 45
Reputación: 0
JairoC Va por buen camino
Hola Amigo!!! Lo pude solucionar!!! Lo que hice fue lo siguiente:
Creé una variable tipo String, a la cual le asigné una consulta que no se modifica:
Código Delphi [-]
Var
ConsultaGeneral:String
begin
  ConsultaGeneral:=' Select * from Personas'; 
end;
Luego en el botón, lo siguiente:
Código Delphi [-]
with (DM2.General)do
           begin
             if ComboBox_SEXO.Text <>'' then
                ConsultaGeneral:= ConsultaGeneral + ' and SEXO STARTING WITH :SEXO ';
             if Edit_EdadEntre.Text<>'' then
               ConsultaGeneral:=ConsultaGeneral + 'and EDAD BETWEEN :EdadDesde ';
             if Edit_EdadHasta.Text<>'' then
                ConsultaGeneral:=ConsultaGeneral + ' and :EdadHasta ';
             if ComboBox_Cobertura.Text<>'' then
                ConsultaGeneral:=ConsultaGeneral + 'and COBERTURA starting with :Cobertura';
              SQL.Clear;
             sql.Add(ConsultaGeneral);
             if ComboBox_SEXO.Text <>'' then
                ParamByName('Sexo').Value:=ComboBox_SEXO.Text;
            // Y ASÍ CON TODOS LOS QUE TENGO
            Open;

MUchas gracias de nuevo por su ayuda!!! Abrazos!!!
Responder Con Cita