指定字段 [Report].[Field] 可以引用 SQL 语句的 FROM 子句中列出的多个 table

The specified field [Report].[Field] could refer to more than one table listed in the FROM clause of your SQL statement

我正在基于 Microsoft Access 中的查询创建报表,但在从设计视图切换到报表视图时我一直收到错误消息。

The specified field '[Customer Report].[Need Date]' could refer to more than one table listed in the FROM clause of your SQL statement.

我搜索了已经提出的问题,似乎答案很简单:我只需要指定 table [需要] Date] 来自 SQL 编码。但是,我已经这样做了,错误消息继续发生。这是我的报告所基于的查询的编码:

SELECT 
    [UID Only].[Our PN], 
    [UID Only].[Customer PN], 
    [UID Only].Description, 
    [UID Only].[Order #], 
    [UID Only].[Customer PO], 
    [UID Only].[Need Date], 
    [Customer Report].[Need Date], 
    [UID Only].[Unique ID]
FROM ([UID Only] 
LEFT JOIN [UID, Date] ON [UID Only].[Unique ID] = [UID, Date].[Unique ID]) 
LEFT JOIN [Customer Report] ON [UID Only].[Unique ID] = [Customer Report].[Unique ID]
WHERE [UID, Date].[Unique ID] Is Null;

错误来自报表,而不是查询本身。 上面显示的查询产生的记录包含两个名为 [Need Date] 的字段,报表无法区分它们。给他们不同的别名

SELECT
    [UID Only].[Our PN], 
    [UID Only].[Customer PN], 
    [UID Only].Description, 
    [UID Only].[Order #], 
    [UID Only].[Customer PO], 
    [UID Only].[Need Date] AS UO_NeedDate,
    [Customer Report].[Need Date] AS CR_NeedDate,
    [UID Only].[Unique ID]
FROM ([UID Only] 
LEFT JOIN [UID, Date] ON [UID Only].[Unique ID] = [UID, Date].[Unique ID]) 
LEFT JOIN [Customer Report] ON [UID Only].[Unique ID] = [Customer Report].[Unique ID]
WHERE [UID, Date].[Unique ID] Is Null;

现在,在报告中您可以将它们称为 UO_NeedDateCR_NeedDate