Ver Mensaje Individual
  #6  
Antiguo 30-07-2008
Avatar de RolphyReyes
RolphyReyes RolphyReyes is offline
Miembro
 
Registrado: ago 2004
Ubicación: Santo Domingo
Posts: 285
Reputación: 20
RolphyReyes Va por buen camino
Smile

Saludos.

Una idea podría ser, pones tu sentencia SELECT dentro del Editor de SQL en tu componente Query así:
Código SQL [-]
Select * From ENTRADAPELOTAS 
Where NUMERO >= COALESCE(NUMERO, NUMERO) 
and   NUMERO <= COALESCE(:HNUMERO, NUMERO)
and   FECHAENTRADA >= COALESCE(FECHA, FECHAENTRADA)
and   FECHAENTRADA <= COALESCE(:HFECHA, FECHAENTRADA)
and   MARCA >= COALESCE(MARCA, MARCA)
and   MARCA <= COALESCE(:HMARCA, MARCA)
ORDER BY NUMERO

Ahí tienes todos tus parámetros, luego en Delphi:
Código Delphi [-]
With QEntradaPelotas, Params do
begin
  Close;
  ParamByName('DNUMERO').Value := Null;
  ParamByName('HNUMERO').Value := Null;
  .
  .
  .
end;

Luego a medida que tienes valores se lo pasas y los que no se
queda nulos y el COALESCE se encarga de dejarlo en blanco.

A recomendación trata de no tener ningún componente desendiente
de TDataSet en la presentación (formularios) trata de ponerlos
en un DataModule.
__________________
Gracias,
Rolphy Reyes
Responder Con Cita