gpt4 book ai didi

sql - 没有为所需参数提供值

转载 作者:行者123 更新时间:2023-12-02 06:38:44 24 4
gpt4 key购买 nike

我正在尝试针对 Access 数据库运行下面的查询,但我收到错误消息 No value Given for the required parameter?

SELECT        ID, DateColumn, Less90, Between90180, Between180365, GreaterThan365, SUM(Less90) + SUM(Between90180) + SUM(Between180365) + SUM(GreaterThan365) 
AS Total, SUM(Between180365) / Total AS Expr1,
(SELECT SUM(Between180365) / (SUM(Less90) + SUM(Between90180) + SUM(Between180365) + SUM(GreaterThan365))
FROM tblHandpieceFaliuresAge T2
WHERE T2.ID <= tblHandpieceFaliuresAge.ID) AS RunningSum
FROM tblHandpieceFaliuresAge
GROUP BY ID, DateColumn, Less90, Between90180, Between180365, GreaterThan365

最佳答案

您错误地键入了其中一列,Access 认为您正在尝试传递参数。

再次检查您的字段名称并确保它们都已正确输入。

我认为问题可能是这样的:

SUM(Less90) + SUM(Between90180) + SUM(Between180365) + SUM(GreaterThan365) 
AS Total

然后您稍后在此处将其称为 Total:

SUM(Between180365) / Total

Access 无法获取别名并在查询中重新使用它,您需要这样:

SUM(Between180365) / 
(SUM(Less90) + SUM(Between90180) + SUM(Between180365) + SUM(GreaterThan365))

还要确保处理分母,以免除以零。

关于sql - 没有为所需参数提供值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12283242/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com