0

查看以下代码,并建议我可能出错的地方。

SELECT
    Table2.[Mover name],
    Table2.Lead_Type,
    Count(Table2.[Lead_Type]) AS Total_Leads,
    [Total_Charges] AS Expr1
FROM
    Table2
GROUP BY
    Table2.[Mover name],
    Table2.Lead_Type
HAVING
    ((([Total_Charges])=IIf([Table2]![Lead_Type]="Intenrational (2)",
                            [Table2]![Quoted price]*[Table2]![movesouq_charge],
                            IIf([Table2]![Lead_Type]="International car",
                                [Table2]!  [Quoted price]*[Table2]![movesouq_charge],
                                [Query2]![Expr1]*[Table2]![movesouq_charge]
                               )
                           )
    ));

当我尝试运行此查询时,会生成错误“查询定义的选择列表中的别名 Expr1 导致的循环引用。”

4

1 回答 1

0

您将 expr1 作为 Total_Charges 的别名,并在您的 having 子句中作为 query2 名称的一部分。

此外,您的 iif 语句中有拼写错误: IIf([Table2]![Lead_Type]=" Intenrational (2)"

于 2013-09-10T16:46:47.237 回答