|
-
Jul 19th, 2000, 12:46 PM
#1
Thread Starter
New Member
Hi alltogether,
I knew, Access an VB had some Problems with empty DateFields, now I'm sure.
I have got a table which contains some Date Fields, which can, but need not to be filled. Each month the ones with a Date older than TodaysDate will must be deleted.
If I do the following SQL statement to select the records, I get a Datatype mismatch error.
"SELECT * FROM tblTable WHERE DateValue(DateField) <= Date()"
This Statement needs the DateValue() Function because otherwise I get Dates like 05.07.00 (with dd/mm/yy) when TodaysDate is 10.06.00. (because 5 is bigger than 10)
Access is strange ... perhaps anyone can help me in my desaster?
PS: The Select-Statement works! I tested it. Only if some Fields are Empty this Error occurs.
-
Jul 20th, 2000, 03:32 AM
#2
Fanatic Member
Hi maxx
Why don't you check to see whether the column Is null first
"SELECT * FROM tblTable WHERE DateField IS NOT NULL AND DateValue(DateField) <= Date()"
That should sort out your problem
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jul 20th, 2000, 06:07 AM
#3
Thread Starter
New Member
Nope, it does not ... it only does, if I create a query first "SELECT * FROM tblTable WHERE ... IS NOT NULL"
But that's not what I want, because I would have to create tons of Querys just to delete them afterwards ... this would screw up my Database, because it's Access ...
Thanks anyway, any further suggestions?
maxx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|