Tente passar a data como parâmetro:
if radiobutton1.Checked then if DateTimePicker1.Checked then begin adoconmovimento.Active := false; adoconmovimento.SQL.Clear; adoconmovimento.SQL.Add ('select * from movimento a,categoria b,material c,solicitante d where a.codmat = c.codmat and a.tipo = ''E''and b.codcat = c.codcat and _a.data = :DATA1 and b.nome like '+QuotedStr(DBLookupComboBox1.Text+'%')+ ' and c.nome like '+QuotedStr(DBLookupComboBox2.Text+'%')+ 'order by a.data'); adoconmovimento.ParamByName('DATA1').AsDateTime := DateTimePicker1.Date; adoconmovimento.active := true; end ----- Original Message ----- From: "Rodrigo Brito" <[EMAIL PROTECTED]> To: <delphi-br@yahoogrupos.com.br> Sent: Thursday, February 22, 2007 3:47 PM Subject: [delphi-br] Select não funciona > Boa TArde > > tenho esse select na qual faz a filtragem dos meus registros para consulta > mas quando vou escolher a data ele não funciona não retorna nenhum > valor o resto funciona > no sql o campo data está como datetime > > > > if radiobutton1.Checked then > if DateTimePicker1.Checked then > begin > adoconmovimento.Active := false; > adoconmovimento.SQL.Clear; > adoconmovimento.SQL.Add ('select * from movimento > a,categoria b,material c,solicitante d where a.codmat = c.codmat and > a.tipo = ''E''and b.codcat = c.codcat and _a.data = '+ > datetostr(DateTimePicker1.date) +_ ' and b.nome like > '+QuotedStr(DBLookupComboBox1.Text+'%')+ ' and c.nome like > '+QuotedStr(DBLookupComboBox2.Text+'%')+ 'order by a.data'); > adoconmovimento.active := true; > > end > > -- > > > -- > <<<<< FAVOR REMOVER ESTA PARTE AO RESPONDER ESTA MENSAGEM >>>>> > > Links do Yahoo! Grupos > >