Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Invalid Date Expression in Filter?
Wed, May 7 2008 10:59 PMPermanent Link

Dave
I am trying to apply a filter like

MyTable.Filter := 'aDate='+QuotedStr(FormatDateTime('yyyy-mm-dd', Now()));

But I am getting an error "Invalid Date Expression"

Is it the format I am putting the date in?

Thank you
Thu, May 8 2008 3:26 AMPermanent Link

Uli Becker
Dave

> MyTable.Filter := 'aDate='+QuotedStr(FormatDateTime('yyyy-mm-dd', Now()));

In EDB you have to define the date-type like this:

MyTable.Filter := 'Datum = date ' +
QuotedStr(FormatDateTime('yyyy-mm-dd', Now()));

In you case it would be simpler to use:

MyTable.Filter := 'Datum = Current_Date';

Regards Uli
Thu, May 8 2008 3:42 AMPermanent Link

Dave
Uli Becker <test@test.com> wrote:

Dave

> MyTable.Filter := 'aDate='+QuotedStr(FormatDateTime('yyyy-mm-dd', Now()));

In EDB you have to define the date-type like this:

MyTable.Filter := 'Datum = date ' +
QuotedStr(FormatDateTime('yyyy-mm-dd', Now()));

In you case it would be simpler to use:

MyTable.Filter := 'Datum = Current_Date';

Regards Uli

Brilliant. Thank you very much.
Image