MS Access SQL左联接不起作用

时间:2018-06-27 20:52:30

标签: sql-server ms-access ms-access-2007

无法使此ms JET sql查询(查询我未编写的2007 Access数据库)正常工作。错误提到“参数太少,期望4”。我相信这与我的加入有关。

有人知道我想念什么吗?

SELECT TOP 500 [Load Items].[LoadItemsID] AS load_order_line_id,
        lo.[LoadOrderID] AS load_order_id,
        sp.[Description] AS product_description,
        sp.[Common Name] AS product_common_name,
        c.[Bill To Name] AS company_name,
        lp.[Ship Date] AS ship_date,
        al.[Ordered] AS order_quantity,
        al.[Price] AS sell_price,
        a.[Order Date] AS order_date,
        a.[Due Date] AS due_date
        FROM ((((((([Load Items]
            LEFT JOIN [Acknowledgement Lines] AS al
                ON al.[AcknowledgmentLineID] = [Load Items].[AcknowledgmentLineID])
            LEFT JOIN [Product] AS p
                ON p.[ProductID] = al.[ProductID])
            LEFT JOIN [Product Master] AS pm
                ON pm.[ProductMasterID] = p.[ProductMasterID])
            LEFT JOIN [Species] AS sp
                ON sp.[SpeciesID] = pm.[SpeciesID])
            LEFT JOIN [Acknowledgement] AS a
                ON a.[AcknowledgmentID] = al.[AcknowledgmentID])
            LEFT JOIN [Customer] AS c
                ON c.[CustomerID] = a.[CustomerID])
            LEFT JOIN [Load Orders] AS lo
                ON lo.[LoadOrderID] = [Load Items].[LoadOrderID])
            LEFT JOIN [Load Planner] AS lp
                ON lp.[LoadPlannerID] = lo.[LoadPlannerID]
        GROUP BY [Load Items].[LoadItemsID],
            lo.[LoadOrderID],
            sp.[Description],
            sp.[Common Name],
            c.[Bill To Name],
            lp.[Ship Date],
            al.[Ordered],
            al.[Price],
            a.[Order Date],
            a.[Due Date];

1 个答案:

答案 0 :(得分:1)

最可能的原因是字段名称中的拼写错误。就解析器而言,每个与表中试图访问的字段名称都不正确匹配的带括号的字段名称都是一个缺少的参数。