Ms Access Join表在单独的数据库中 [英] Ms Access Join tables in separate databases

查看:103
本文介绍了Ms Access Join表在单独的数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

im试图创建一个查询,该查询将保留两个表的连接(这些表位于本地驱动器的两个不同数据库中).到目前为止,我已经提出了这个SQL语句,但是当我运行查询时,它告诉我FROM子句中的语法有错误.

im trying to create a query that will left join two tables(the tables are in two different databases in my local drive). So far I have come up with this SQL statement but when i run the query it tells me there is an error in the syntax in the FROM clause.

SELECT Daily_Report.* INTO AUDIT_TABLE
FROM Daily_Report LEFT JOIN [YTD-Daily_Report] 
IN 'C:\QA_Daily_YTD_Report_Export.accdb'
ON Daily_Report.RecordName = [YTD-Daily_Report].RecordName
WHERE ((([YTD-Daily_Report].RecordName) Is Null));

与本地表(Daily_Report)相比,查询输出一个新表(AUDIT_TABLE)并包含外部表(YTD-Daily_Report)中不存在的记录.

The query outputs a new Table(AUDIT_TABLE) with the records that do not exist in the external table(YTD-Daily_Report) when compared to the local table(Daily_Report).

我从来没有在单独的数据库中查询表,所以在这里我很迷失了,任何帮助将不胜感激.

I have never query tables in separate databases so im pretty lost here, any help would be much appreciated.

推荐答案

为您完成以下工作:

SELECT dr.* INTO AUDIT_TABLE
FROM Daily_Report AS dr
LEFT JOIN [;database=C:\QA_Daily_YTD_Report_Export.accdb].[YTD-Daily_Report] AS ytd
   ON dr.RecordName = ytd.RecordName
WHERE ytd.RecordName Is Null

这篇关于Ms Access Join表在单独的数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆