问题
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 changeRound([Revenue Amount]/[Quantity],2)
intoRound([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