|
-
Dec 3rd, 2002, 09:48 AM
#1
Thread Starter
Member
How to check dates
I created a field of type Date/Time using Visual Data Manager
I am not able to use select statement with where clause like this,
recordset.open "select * from tablename where datefield>'" & DTpicker1.value & "'",db, db, adOpenStatic, adLockOptimistic
how do I check date/time values in a table using the DTpicker controls in a form
I want to select orders make between given two dates
Warm Ragards
Kavitha
-
Dec 3rd, 2002, 03:22 PM
#2
Addicted Member
Hi
Try
recordset.open "select * from tablename where datefield >" & DTpicker1.value, db, db, adOpenStatic, adLockOptimistic
You passed string to date earlier, just remove the " ' " from ur statement
-
Dec 3rd, 2002, 10:28 PM
#3
Thread Starter
Member
Thanks Diban.
Though I dont get any error messages, the records are not getting selected.
Is there someother soln.
Regards
Kavitha
-
Dec 5th, 2002, 12:31 AM
#4
Try substituting the apostrophes with hashes #. Also, SQL expects dates to be passed as month/day/year.
Give this a try:
VB Code:
Dim sql As String
sql = "select * from tablename where datefield > #" & Format$(DTpicker1.Value,"m/d/yy") & "#"
recordset.open sql, db, db, adOpenStatic, adLockOptimistic
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
|