|
-
Aug 5th, 1999, 08:59 PM
#1
Thread Starter
New Member
Sorry to bother you again. I am stumped, and I have looked everywhere for
the solution but cannot find it. You have in the past been so kind in
helping me, I was wondering whether you would be prepared to help me again.
THis is my problem. Dates in SQL with VB. Why doesn't the following code
work!
Set patientDataLEAP = dbLEAP.OpenRecordset("SELECT * From patientRecords
Where DateOfRegistration < #01/08/99#")
Or
Set patientDataLEAP = dbLEAP.OpenRecordset("SELECT * From patientRecords
Where DateOfRegistration < '01/08/99')
Or
Set patientDataLEAP = dbLEAP.OpenRecordset("SELECT * From patientRecords
Where DateOfRegistration < " & Cdate(01/08/99))
How can I compare dates? Help
Any help is much appreciated.
Cheers
Angus
-
Aug 5th, 1999, 09:22 PM
#2
Lively Member
Hi,
This is the right one:
Set patientDataLEAP = dbLEAP.OpenRecordset("SELECT * From patientRecords
Where DateOfRegistration < #01/08/99#")
What you could do is try building the SQL statement in Access Query Designer. This will give you the correct syntax for your SQL Statement.
Also, what is the error message that you get? It might not even be comparing dates!
Preeti
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
|