Board index » delphi » Filtering out records with empty date field

Filtering out records with empty date field

Hello,

I would like to filter out all records in a table for which nothing has
been entered into a date field.
I would like to do this with the filter property of a table.
For a string field I would enter in the Filter property of the table:
   Stringfield = ''

Everything I tried for the date field resulted in invalid date and other
ererors.
Can anybody help me,

Many thanks in advance,

Peter Peeters
Peter.Peet...@vub.ac.be

 

Re:Filtering out records with empty date field


Use the OnFilterEvent
In the event:
 if Table1.FieldByName('datefieldname').IsNull then
don't accept the record
Quote
"Peter H. Peeters" wrote:
> Hello,

> I would like to filter out all records in a table for which nothing has
> been entered into a date field.
> I would like to do this with the filter property of a table.
> For a string field I would enter in the Filter property of the table:
>    Stringfield = ''

> Everything I tried for the date field resulted in invalid date and other
> ererors.
> Can anybody help me,

> Many thanks in advance,

> Peter Peeters
> Peter.Peet...@vub.ac.be

Other Threads