I'm trying to do a SQL query against an Access 2002 DB with a Date/Time field. The format of the field is "mm.dd.yyyy hh:mm:ss AM"
I'm using a calendar control to get a date to search the database. My SQL statement looks like this:
Dim strSQL As String = "SELECT * FROM Table1 WHERE DateEntered Like " & Calendar1.SelectedDate
but it returns nothing.
or if I try and use "LIKE" as in the statement below I get nothing:
Dim strSQL As String = "SELECT * FROM Table1 WHERE DateEntered Like '*' & #4/30/2003# & '*'"
What am I missing? Any help greatly appreciated.
Marc
I'm using a calendar control to get a date to search the database. My SQL statement looks like this:
Dim strSQL As String = "SELECT * FROM Table1 WHERE DateEntered Like " & Calendar1.SelectedDate
but it returns nothing.
or if I try and use "LIKE" as in the statement below I get nothing:
Dim strSQL As String = "SELECT * FROM Table1 WHERE DateEntered Like '*' & #4/30/2003# & '*'"
What am I missing? Any help greatly appreciated.
Marc