Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread DateTime Filtering
Sat, Nov 4 2006 4:34 PMPermanent Link

"Omik_1"
What is the correct way to set a table filter on a DateTime field in a
DBISAM table?

The following give error in expression.

Table.Filter := 'DateTimeFieldName >= 01/01/2005';

Table.Filter := 'DateTimeFieldName >= ' +
QuotedStr(DateTimePicker.DateTime);

Regards

Sat, Nov 4 2006 4:51 PMPermanent Link

"Ralf Mimoun"
Omik_1 wrote:
> What is the correct way to set a table filter on a DateTime field in a
> DBISAM table?
>
> The following give error in expression.
>
> Table.Filter := 'DateTimeFieldName >= 01/01/2005';
>
> Table.Filter := 'DateTimeFieldName >= ' +
> QuotedStr(DateTimePicker.DateTime);

DBISAM use the ANSI format for date, time and floats - for what I can't
thank Elevate enough. So, just write

Table.Filter := 'DateTimeFieldName >= ''2005-01-01'''; // you have to set a
date in quotes

Table.Filter := 'DateTimeFieldName >= ' +
QuotedStr(AnsiDateTimeToStr(DateTimePicker.DateTime, True)); // .DateTime
should be a TDateTime

Ralf
Image