[Lazarus] Filtering on date with TDbf

Koenraad Lelong lazarus1 at de-brouwerij.be
Wed Feb 1 10:40:51 CET 2012


On 31-01-12 13:55, Guionardo Furlan wrote:
> This code works in delphi?
> Comparing strings doesn´t work for dates, I guess.
> Using mm/dd/yyyy, "05/01/2012" is less/before than "05/02/2011"
>
...
Hi,

I don't want to compare "dates as strings", I want to compare dates with 
other dates, as dates. The thing is the filter in TDbf is a string. So 
how would I specify that filter if not as a string ?

In Lazarus I tried also
datum >= '2011-01-01'
datum >= "2011-01-01"
Same error : Index based on unknown field ">="
That's when I enter the filter with the TDbf active.
If I enter this with the TDbf closed, and then open the TDbf, the filter 
just disappears.

AFAIK, TDbf is has no SQL, so this can't be used. Besides, with Firebird
... where datum >= '5.9.2011'
is perfectly valid to have all dates from/including sept 5 2011, I just 
checked.

So, any other suggestions ?
Thanks for your replies.

Koenraad.




More information about the Lazarus mailing list