Filtering out records with empty date field

Filtering out records with empty date field

Post by Peter H. Peeter » Sun, 31 Dec 1899 09:00:00



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

 
 
 

Filtering out records with empty date field

Post by Shu » Sun, 31 Dec 1899 09:00:00


Use the OnFilterEvent
In the event:
 if Table1.FieldByName('datefieldname').IsNull then
don't accept the record

> 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



 
 
 

1. How do I store an empty date on a date field (MS Access)

Good question. There is no "empty" date. In the database where the data is
stored you can place a NULL if you have allowed NULLs in the column.
Otherwise, use the date Dec. 30, 1899 (Access) or Jan. 1, 1900 (SQL Server)
or whatever your particular DB uses as its beginning date, and program
around it. That is, when the date is equal to 0, display or print
differently than when it has a "real" date in it.
This all assumes you don't ever USE the beginning date. If you are doing
geneologies or historical data only the NULL method will be of any use.
HTH
--
Gary (MCT, MCPS, MCSD)
http://www.enter.net/~garyl/  for references to good books

ICQ 6375624

2. Simulating replication

3. vb6 date variables comparing with access date fields returns always empty recordset

4. How to generate script for stored procedure in ISQLW?

5. Filtering Empty Records

6. Hi, how to integrate WALLET with my web site

7. Filter Accross Date Range - Different Filter Value for Different Dates

8. How to change the owner of a user defined data type

9. filter out the blank (empty) field

10. show members with empty measure values/filters on filters

11. How to store empty to Date field ?

12. Import an empty date field

13. Data Manager and empty Date/Time fields