Sum IIF 查询错误 - 不能使用子查询
Sum IIF query error - subqueries cannot be used
我正在尝试使此查询正常工作,但抛出了不能在表达式中使用子查询的错误...
SELECT qrySrcReq.MDC_Office,
Count(qrySrcReq.ReqNumKey) AS Ct_ReqNRs,
Count(IIf([3PL]="yes",0)) AS Ct_3PLReqNrs,
Count(IIf([3PL] Is Null,0)) AS Ct_OtherReqNrs,
Sum(IIf([3PL]="yes",[BO_Qty],0)) AS Sum_3PLBOs,
Sum(qrySrcReq.BO_Qty) AS BO_Qty,
IIf([qrySrcReq]![Priority] Like "04*","3PL","Tactical") AS Strategy
FROM qrySrcReq
WHERE (((qrySrcReq.Priority) Like "04*") AND ((qrySrcReq.[3PL Status])="C")) OR (((qrySrcReq.Priority) Is Not Null) AND ((qrySrcReq.[3PL Status]) Is Null Or (qrySrcReq.[3PL Status])=""))
GROUP BY qrySrcReq.MDC_Office,
IIf([qrySrcReq]![Priority] Like "04*","3PL","Tactical");
抛出错误的行是:
Sum(IIf([3PL]="yes",[BO_Qty],0)) AS Sum_3PLBOs
是否有另一种方法可以解决此问题以使其正常工作?谢谢
改变
Sum(qrySrcReq.BO_Qty) AS BO_Qty
到
Sum(qrySrcReq.BO_Qty) AS Sum_BO_Qty
我正在尝试使此查询正常工作,但抛出了不能在表达式中使用子查询的错误...
SELECT qrySrcReq.MDC_Office,
Count(qrySrcReq.ReqNumKey) AS Ct_ReqNRs,
Count(IIf([3PL]="yes",0)) AS Ct_3PLReqNrs,
Count(IIf([3PL] Is Null,0)) AS Ct_OtherReqNrs,
Sum(IIf([3PL]="yes",[BO_Qty],0)) AS Sum_3PLBOs,
Sum(qrySrcReq.BO_Qty) AS BO_Qty,
IIf([qrySrcReq]![Priority] Like "04*","3PL","Tactical") AS Strategy
FROM qrySrcReq
WHERE (((qrySrcReq.Priority) Like "04*") AND ((qrySrcReq.[3PL Status])="C")) OR (((qrySrcReq.Priority) Is Not Null) AND ((qrySrcReq.[3PL Status]) Is Null Or (qrySrcReq.[3PL Status])=""))
GROUP BY qrySrcReq.MDC_Office,
IIf([qrySrcReq]![Priority] Like "04*","3PL","Tactical");
抛出错误的行是: Sum(IIf([3PL]="yes",[BO_Qty],0)) AS Sum_3PLBOs
是否有另一种方法可以解决此问题以使其正常工作?谢谢
改变
Sum(qrySrcReq.BO_Qty) AS BO_Qty
到
Sum(qrySrcReq.BO_Qty) AS Sum_BO_Qty