I have in a cell in Excel: MM/DD/YYYY
I want to add it to my Access database as: YYYY/MM/DD
This is what I have so far in Excel VBA. It is giving me a date error. I have tried both as MM/DD/YYYY still did not work.
Code:
n=1
accDateSub="01/01/2011"
Dim conn As New ADODB.Connection
conn.Open ConnectionString:="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\path\file1.accdb;"
thisSQL = "INSERT INTO [Table1] VALUES (" & n & ", #" & Format(accDateSub, "yyyy/mm/dd") & "#);"
conn.Execute CommandText:=thisSQL