在访问我这样做:
insert into accounts_changes
(select *
from accounts
where [Agency Code]
in (select * from tableimport))
Run Code Online (Sandbox Code Playgroud)
它说它不喜欢这个INSERT语句
更新:
sSql = "insert into accounts_changes (select * from Accounts where [Agency Code] in (select [Agency Code] from tableimport))"
Run Code Online (Sandbox Code Playgroud)
我做了什么标记说它仍然给我相同的错误信息
syntax error in INSERT INTO statement
Run Code Online (Sandbox Code Playgroud)
当我这样做:
ssql = "select [Agency Code] from tableimport"
CurrentDb.Execute ssql
Run Code Online (Sandbox Code Playgroud)
它说不能执行SELECT QUERY
Mar*_*ers 14
这是错的:
select *
from accounts
where [Agency Code] in (select * from tableimport)
Run Code Online (Sandbox Code Playgroud)
您只能在子查询中为IN子句选择一列.你想要这样的东西:
select *
from accounts
where [Agency Code] in (select [Agency Code] from tableimport)
Run Code Online (Sandbox Code Playgroud)
您需要检查表中列的确切名称tableimport.以上只是我最好的猜测.