Hi
I’m importing a date which is in the format dd.mm.yyyy. I need this field as a date in my database.
The following works in a Query:
LEFT(Import_Table.F6],2)+"/"+MID([Import_Table.F6],4,2)+"/"+RIGHT([Import_Table.F6],4)
When I transfer this to VBA Code though, it doesn’t work.
Dim sql As String
sql = "INSERT INTO TABLE_Namel ( StartDate ) SELECT Import_Table. LEFT(Import_Table.F6],2)&"/"&MID([Import_Table.F6],4,2)&"/"&RIGHT([Import_Table.F6],4) FROM Import_Table WITH OWNERACCESS OPTION;"
DoCmd.RunSQL (sql)
Can anyone put me straight on this?
Help appreciated.
Ginny
I’m importing a date which is in the format dd.mm.yyyy. I need this field as a date in my database.
The following works in a Query:
LEFT(Import_Table.F6],2)+"/"+MID([Import_Table.F6],4,2)+"/"+RIGHT([Import_Table.F6],4)
When I transfer this to VBA Code though, it doesn’t work.
Dim sql As String
sql = "INSERT INTO TABLE_Namel ( StartDate ) SELECT Import_Table. LEFT(Import_Table.F6],2)&"/"&MID([Import_Table.F6],4,2)&"/"&RIGHT([Import_Table.F6],4) FROM Import_Table WITH OWNERACCESS OPTION;"
DoCmd.RunSQL (sql)
Can anyone put me straight on this?
Help appreciated.
Ginny