I've Googled for the answer to this but haven't found the right right way to use the # sign for a date field. I have the following SQL update statement:
strSQL = "update tblStocks set tblStocks.[Next Ex-Dividend] = " & dtExDivDate & " Where tblStocks.Symbol = " & "'" & strSymbol & "'"
dtExDivDate is declared as Date field. This creates the following SQL string:
"update tblStocks set tblStocks.[Next Ex-Dividend] = 10/8/2021 Where tblStocks.Symbol = 'T'"
This runs but the resulting value inserted into [Next Ex-Dividend] (defined as short date) is 12/30/1899
What do I need to do with this date field to get it to update correctly? I always seem to have a problem with date fields...
Thanks.