SQL Reporting Services - 我可以对包含表达式的字段求和吗?
如果我的 SQL 2008 报告中有一个通过表达式(意味着不是直接从数据集生成)生成的字段,我应该能够对其进行求和吗?我可以以某种方式在后续表达式中引用该字段 - 例如通过引用框名称吗?
If I have a field in my SQL 2008 report that is generated via expression (meaning not directly from a dataset) should I be able to SUM
it? Can I reference the field in a subsequent expression somehow - like by referencing the box name?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的问题并不完全清楚......但我会尝试一下。
您的意思是这样吗:
这将计算 6 个数字的总和(因为
BETWEEN
语句的范围包含两端)。您将无法在
WHERE
子句中“立即”引用字段别名 -但是,它将在
ORDER BY
和GROUP BY
中可用code> 子句,以及如果您将查询包装在其他内容中(CTE、内联表、etx);Your question isn't completely clear... but I'll take a stab at it.
Do you mean something like this:
This will sum 6 numbers (because the range of a
BETWEEN
statement is inclusive on both ends).You won't be able to reference the field alias 'immediately' in the
WHERE
clause -However, it will be available in
ORDER BY
andGROUP BY
clauses, and also if you wrap the query in something else (CTE, inline table, etx);