对于MS Access中的多个Left Join,“不支持连接表达式”

时间:2017-12-08 13:49:21

标签: sql ms-access oledb

我有以下查询,我在ASP.NET项目中作为字符串传递:

SELECT creditorName, amount, interestRate, interestType, interestCalculationMethod, insertedDate, o.fullName AS owner, u.fullName AS dataInsertedBy FROM ((tbl_savings s) LEFT JOIN tbl_users o ON (ownerID = o.userID)) LEFT JOIN tbl_users u ON (dataEnteredByID = u.userID);

我收到以下错误:

+       $exception  {"Join expression not supported."}  System.Data.OleDb.OleDbException

我使用MS Access 2016作为数据库。

怎么了?

1 个答案:

答案 0 :(得分:0)

我在MSDN上找到了解决方案。这是链接:

https://social.msdn.microsoft.com/Forums/office/en-US/15c36745-f7a4-4926-9687-7161e5894468/join-expression-not-supported-error-caused-by-unbracketed-join-expression-comprising-string?forum=accessdev

我很抱歉没有提供正确的答案以及我发布的链接。这是正确的答案:

select savingsID, creditorName, amount, interestRate, interestType, interestCalculationMethod, insertedDate, ownerID, o.fullName as owner, u.fullName as dataEnteredBy from((tbl_savings as s) left join tbl_users as o on s.ownerID = o.userID) left join tbl_users as u on s.dataEnteredByID = u.userID