select data between two dates and two times

I want to select data from table paradox from (Date1,Time1) to (Date2,Time2) for example from 01/02/2018 time:22:00:00 to 14/02/2018 time 09:00:00 i'm using delphi 7
Toutou la bellaAsked:
Who is Participating?
Geert GOracle dbaCommented:
or with parameters ...

query1.sql.text := 'select mydata from table where Data >= :date1 and data <= :date2';
query1.ParamByName('Date1').asDateTime := EncodeDate(2018,2,1) + EncodeTime(22,0,0,0);
query1.ParamByName('Date2').asDateTime := EncodeDate(2018,2,14) + EncodeTime(9,0,0,0);

Open in new window

Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
A little more inputs about the table structure and how you want to select datas (by table filter or query sql) could give more info on how to help.
Anyway use something like "select mydata from table where Data between Data1 and Data2 and Time between Time1 and Time2"
Toutou la bellaAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.