procedure TForm1.Button6Click(Sender: TObject); var start_ido : string; end_ido : string; formatum : TFormatSettings; begin formatum.ShortDateFormat := 'HH.mm'; start_ido:=datetostr(DateTimePicker1.Time,formatum); end_ido:=datetostr(DateTimePicker2.Time,formatum); Edit2.Text:=start_ido; Edit3.Text:=end_ido; if AdoQuery1.Active then AdoQuery1.Close; AdoQuery1.SQL.Clear; AdoQuery1.SQL.Add('SELECT * FROM cardmanager WHERE Ido >= '+QuotedStr(start_ido)+' and Ido <= '+QuotedStr(end_ido)); AdoQuery1.Open; end;