Ver Mensaje Individual
  #2  
Antiguo 11-11-2008
Avatar de ContraVeneno
ContraVeneno ContraVeneno is offline
Miembro
 
Registrado: may 2005
Ubicación: Torreón, México
Posts: 4.738
Reputación: 24
ContraVeneno Va por buen camino
Código Delphi [-]

with UnADOQuery do begin
 If active then close;
 SQL.Clear;
 SQL.Add('Select T.UnCampo, T.OtroCampo, T.Fecha');
 SQL.Add('From UnaTabla T');
 SQL.Add('Where T.Fecha between :FechaInicial and :FechaFinal');
 Parameters.ParamByName('FechaInicial').Value := UnDTPicker.DateTime;
 Parameters.ParamByName('FechaFinal').Value := OtroDTPicker.DateTime;
 Open;
 ShowMessage(FieldByname('UnCampo').AsString);
end; //with

recuerda que en SQL Server el tipo DateTime guarda la fecha y la hora, por lo que NO es necesario (y no es recomendable) tener un campo para la fecha y otro diferente para la hora.
__________________

Responder Con Cita