IIf()公式太复杂,无法运行查询运行时错误[英] IIf() formula too complex to run query - runtime error

本文是小编为大家收集整理的关于IIf()公式太复杂,无法运行查询运行时错误的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我在 Access 数据库中有一个查询,当我尝试运行它时,我收到一条错误消息"查询太复杂而无法运行."运行时错误 3360."问题在于一个公式/编程逻辑,见下文:

以前的公式如下 - 它有效.

展开|选择|Wrap|行号

推荐答案

我看不出问题是什么,但是有一些提示这可能会有所帮助.

我建议你把 Nz 放在你的每个领域.
我建议您将公式复制到笔记本上(更容易阅读),然后将每个条件块设置在单独的行上.
检查每一行的包围.EG

展开|选择|Wrap|行号

你能发布整个查询的SQL吗?
您可能在连接、SQL 长度、WHERE 子句长度等方面遇到了一些限制......
(这是可能弹出此错误的一种情况
在 Access 2007 中运行查询时出现错误消息:"超出系统资源"或"查询太复杂")

也许您会发现使用 Switch() 函数而不是多个IIf().

本文地址:https://www.itbaoku.cn/post/1050682.html

问题描述

I have a query in Access Database and when I try to run it, I get an error message "query is too complex to run." Runtime error 3360." The problem is with one formula / programming logic, see below:

Previously the formula was the below - and it worked.

Expand|Select|Wrap|Line Numbers

推荐答案

I can''t see off hand what the problem is, but a few tips which may help.

I suggest you put Nz round each of your fields.
I suggest you copy the formula to notebook (it''s easier to read) then set each block of conditions on a separate line.
Check the bracketing round each line. E.G

Expand|Select|Wrap|Line Numbers

Would you post the entire SQL for the query?
You may have ran into some limitations for joins, length of SQL, length of WHERE clause etc....
(here''s one such situation where this error can pop-up
Error message when you run a query in Access 2007: "System Resource Exceeded" or "Query is too complex")

Perhaps you''d find the whole equation simpler to express using the Switch() function instead of multiple IIf()s.