Insert into from another database

plus_stick

New member
Local time
Tomorrow, 05:55
Joined
Jul 10, 2013
Messages
7
Hi everyone.
I'm trying to copy records from another base into existing table in current base by:
Code:
DoCmd.RunSQL ("INSERT INTO pivot (RFO_CLIENT_ID, FOLDER_DATE_CREATE, start_time, end_time) SELECT (RFO_CLIENT_ID, FOLDER_DATE_CREATE, start_time, end_time) FROM svod IN 'Z:\NPS\NPS - Operator - 1.accdb' ")
But it doesn't run.
Says insert into syntax error.
Please, correct my code.
Thanks in advance.
 
Remove the Parentheses after the SELECT and before the FROM Keywords !
 
Show the edited code again.

Code:
DoCmd.RunSQL ("INSERT INTO pivot (RFO_CLIENT_ID, FOLDER_DATE_CREATE, start_time, end_time) SELECT RFO_CLIENT_ID, FOLDER_DATE_CREATE, start_time, end_time FROM svod IN 'Z:\NPS\NPS - Operator - 1.accdb' ")
 
pivot is a reserved word, try changing the name of your destination table or at least put square brackets around it
 

Users who are viewing this thread

Back
Top Bottom