Board index » delphi » TDateTime Parameters and TDateTimePicker

TDateTime Parameters and TDateTimePicker

I have noticed strange behavior when using TDateTime.DateTime to fill a
DateTime parameter within a TQuery. with the SQL as
SELECT * FROM blah
WHERE blah BETWEEN :START_DATE AND :END_DATE

It seems the end date parameter works fine but the start date parameter is a
day out. ie if 25/11/1998 to 25/12/1998 is chosen you will only get records
returned for 26/11/1998 to 25/12/1998????

Any help is appreciated.

Paul Hopkins
Software Engineer
Inprise Certified JBuilder Developer & Trainer
Inprise Certified Delphi Developer & Trainer
----------------------------------------------------------------------------
------
Dunstan Thomas Ltd.
http://www.dthomas.co.uk

 

Re:TDateTime Parameters and TDateTimePicker


I have found the solution to this problem. It is down to the Time property.
It was set to about 17:15. If this is set to 0 it will return results for
the whole day. Likewise, the end date DateTimePicker must have its time set
to 23:59:59

Quote
Paul Hopkins wrote in message <7d7u65$k...@forums.borland.com>...
>I have noticed strange behavior when using TDateTime.DateTime to fill a
>DateTime parameter within a TQuery. with the SQL as
>SELECT * FROM blah
>WHERE blah BETWEEN :START_DATE AND :END_DATE

>It seems the end date parameter works fine but the start date parameter is
a
>day out. ie if 25/11/1998 to 25/12/1998 is chosen you will only get records
>returned for 26/11/1998 to 25/12/1998????

>Any help is appreciated.

>Paul Hopkins
>Software Engineer
>Inprise Certified JBuilder Developer & Trainer
>Inprise Certified Delphi Developer & Trainer
>---------------------------------------------------------------------------
-
>------
>Dunstan Thomas Ltd.
>http://www.dthomas.co.uk

Other Threads