I am using Access to write a form that will utilize a calendar control to get a date and past that in a sql string that will get the corresponding's date information.
This is not working for me. There are no rows returned. When using
strSQL = "Select * from Table Where sDate = ""09/23/2008"""
I get the necessary information
However, when using
Dim dtDate as Date
dtDate = Me.Calendar0.Value
strSQL = "Select * from Table Where sDate = ""
strSQL = strSQL & CStr(dtDate) & """
I get no rows returned. Even when I take out the CStr(), the same no rows is returned.
I have written an If...Then statement to test and dtDate = "09/23/2008" is not true nor with CStr().
Any help with getting the value of a calendar control into a SQL string inwhich the database will recognize is great. Even if a parameterized query would be good; I would need to be instructed with the course of action to pass the value in since I was unsuccessful before.
Thank you,
P Dunn
Enter your message below
Sign in or Join us (it's free).