我已将MS Excel中的数据导入MS Access数据库中的临时表(即tblStagingTable),并希望将导入的数据传输到其目标表(即tblPayment),但目标表包含来自另一个表的外键( tblApprovals)。我编写了一个更新sql,使用来自tblStagingTable的3个匹配列和一个查询作为条件,将外键数据添加到tblStagingTable中。一切似乎都没问题,但更新声明无效,请帮助我。
UPDATE tblStagingTable INNER JOIN
qryPaymentImport4Approval
ON (tblStagingTable.MGL_No = qryPaymentImport4Approval.MGL_Number) AND
(tblStagingTable.Fiscal_Year = qryPaymentImport4Approval.Fiscal_Year) AND
(tblStagingTable.Grant_Number = qryPaymentImport4Approval.Grant_Number)
SET tblStagingTable.Approval_ID = [qryPaymentImport4Approval].[Approval_ID];