I have written code to update the [Date] field of a table. According to Debug.Print, my SQL statement appears to be retrieving the correct information, but when I open the corresponding table, the date entered does not match. My code is
The Debug.Print reveals
However, the value appearing in the table is 12/30/1899.
dteDate is set as a date variable. I also tried setting it as a string, but that didn't have good results either.
Any ideas on what I am doing wrong? Thanks in advance.
Code:
strSQLUpdate = "UPDATE tblTotalDealerMetrics " & _
"SET [Date] = " & dteDate & " ; "
The Debug.Print reveals
Code:
UPDATE tblTotalDealerMetrics SET [Date] = 12/31/2006 ;
However, the value appearing in the table is 12/30/1899.
dteDate is set as a date variable. I also tried setting it as a string, but that didn't have good results either.
Any ideas on what I am doing wrong? Thanks in advance.