Hi there,
can anyone tell me why the following code works if the "InitialDate" field is a text field but not when it is set to a Date/Time type:
Private Sub Command0_Click()
Dim dbs As Database
Dim myrs As Recordset
Set dbs = CurrentDb
Set myrs = dbs.OpenRecordset("SELECT * FROM Customers WHERE InitialDate = '04/01/2000'"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Debug.Print myrs!CustId
Please dont say that I should put "#" where the "'" are at the moment (around the date) as it doesn't work. Anyone's brain not fried from the weekend??
can anyone tell me why the following code works if the "InitialDate" field is a text field but not when it is set to a Date/Time type:
Private Sub Command0_Click()
Dim dbs As Database
Dim myrs As Recordset
Set dbs = CurrentDb
Set myrs = dbs.OpenRecordset("SELECT * FROM Customers WHERE InitialDate = '04/01/2000'"
Debug.Print myrs!CustId
Please dont say that I should put "#" where the "'" are at the moment (around the date) as it doesn't work. Anyone's brain not fried from the weekend??