Ver Mensaje Individual
  #7  
Antiguo 12-05-2010
odrack odrack is offline
Miembro
 
Registrado: feb 2008
Posts: 167
Reputación: 17
odrack Va por buen camino
Hola!!

Quiza sea un poco tarde y seguramente ya lo hayan resuelto, pero a alguien mas le pueda servir si tiene el mismo problema.

Colocar dos datetimepicker y dos variables
var fecha1, fecha2:string;

el siguiente codigo hace la busqueda

Código Delphi [-]
//formatea la fecha
 fecha1:=formatdatetime('YYYY-MM-DD', datetimepicker1.date);
  fecha2:=formatdatetime('YYYY-MM-DD', datetimepicker2.date);
 
//busca datos en tabla
  query1.Close;
  query1.SQL.Clear;
  query1.SQL.Text:='select * from tabla where fecha between '+quotedstr(fecha1)+' and '+quotedstr(fecha2);
  query1.ExecSQL;
  query1.Open;


Saludos!!
Responder Con Cita