MS ACCESS The specified field [XXXXX} could refer to more than one table listed in the FROM

谁都会走 提交于 2021-01-29 09:12:13

问题


I'm getting the following error when trying to run a Query in MS ACCESS. The specified field "[XXXX}" could refer to more than one table listed in the FROM Clause of your SQL Statement.

Not sure how to go about this error in MS Access. I'm very new in MS Access.

SELECT Round([Revenue Amount]/[Quantity],2) AS [Rate Paid]
FROM ([Profit Report] RIGHT JOIN ([HBMA 001] INNER JOIN [Key Report] ON [HBMA 001].ID = [Key Report].ID) 
ON ([Profit Report].[S Number] = [Key Report].[S Number]) AND 
([Profit Report].[SL Number] = [Key Report].[SL Number])) 
LEFT JOIN [LTB Analysis] ON [Key Report].[LTB Number] = [HHB LTB Analysis].[LTB Number]

回答1:


The error description is quite clear: you certainly have 2 (or more) tables with identical field names: [Revenue Amount] and/or [Quantity]. Just fix that by prefixing the field name by the table name.
e.g:

SELECT Round([sometable].[Revenue Amount]/[someOtherTable].[Quantity],2) AS [Rate Paid]   

in Design view, just change
Round([Revenue Amount]/[Quantity],2) into
Round([sometable].[Revenue Amount]/[someOtherTable].[Quantity],2)
(using the right table names of course)



来源:https://stackoverflow.com/questions/57892084/ms-access-the-specified-field-xxxxx-could-refer-to-more-than-one-table-listed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!