Board index » delphi » Filtering on Date field

Filtering on Date field

When I filter a table with the following OnFilter code:

    Accept:= DataSet.FieldByName('DATE').AsDateTime >= Date;

I do get the records I need, but the DATE field for all of them is
changed
to the current date (Date) in the table displayed.

What I need is to get these records but display the actual values of the
DATE field.
Perhaps I shouldn't have named this field 'DATE'?

Thanks for any guidance on this.

John

 

Re:Filtering on Date field


Hi,

Don't believe it...
What's the BD you are using ?
The change is permanent or only on the DB Controls ? Check this with the
DataBaseDektop.

Cheers,

--
Elio Medeiros
Rio de Janeiro - Brasil
e-mail <el...@hotmail.com>

Re:Filtering on Date field


No, it's not permanent. It just shows up in the controls (DBGrid, in this
case.) The actual table keeps the original data.  If the data in the table
is:
                         DATE                     NAME
                        10/9/98                    JONES
                        10/11/98                  SMITH

...and I filter the dataset with that code (....>= Date .... and the current
date is 9/6/98),
I get the following....

                        10/6/98                    JONES
                        10/6/98                    SMITH
Strange....

Quote
Elio Medeiros wrote:
> Hi,

> Don't believe it...
> What's the BD you are using ?
> The change is permanent or only on the DB Controls ? Check this with the
> DataBaseDektop.

> Cheers,

> --
> Elio Medeiros
> Rio de Janeiro - Brasil
> e-mail <el...@hotmail.com>

Other Threads