我在 Access 数据库中有一个查询,当我尝试运行它时,出现一条错误消息“查询太复杂而无法运行。”运行时错误 3360。”问题出在一个公式/编程逻辑上,如下所示:
以前的公式如下-并且有效。
IIf([BegTaxBasis]=0 And [Contribution]+[Distribution]=0,0,IIf([BegTaxBasis]=0 And [TaxIncSubTotal]=0,-[Distribution],IIf([Distribution]=0,0,IIf([TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse]<[Distribution],-[Distribution],0))))
上述内容的详细版本如下:
IIf(
[BegTaxBasis]=0 And [Contribution]+[Distribution]=0,
0,
IIf(
[BegTaxBasis]=0 And [TaxIncSubTotal]=0,
-[Distribution],
IIf(
[Distribution]=0,
0,
IIf(
[TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse]<[Distribution],
-[Distribution],
0
)
)
)
)
然后我将其更新为,如下所示:
IIf([BegTaxBasis]=0 And [Contribution]+[Distribution]=0,0,IIf([BegTaxBasis]=0 And [TaxIncSubTotal]=0,-[Distribution],IIf([Distribution]=0,0,IIf([TBBLL]>0,0,IIf([TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse]<[Distribution],-[Distribution],IIf([TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse]>[Distribution] And [TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse]<0 And [TaxIncSubTotal]<0,[TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse]-[TaxIncSubTotal],[TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse])))))
上述内容的详细版本:
IIf(
[BegTaxBasis]=0 And [Contribution]+[Distribution]=0,
0,
IIf(
[BegTaxBasis]=0 And [TaxIncSubTotal]=0,
-[Distribution],
IIf(
[Distribution]=0,
0,
IIf(
[TBBLL]>0,
0,
IIf(
[TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse]<[Distribution],
-[Distribution],
IIf(
[TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse]>[Distribution] And [TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse]<0 And [TaxIncSubTotal]<0,
[TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse]-[TaxIncSubTotal],
[TBBLL]+[Recourse]+[QualifiedNonrecourse]+[NonRecourse]
)
)
)
)
)
现在查询无法运行,非常感谢任何帮助,谢谢!