【问题标题】:Sum a column in Crystal Report and When is Empty Sum = 0在 Crystal Report 中对一列求和,何时为空 Sum = 0
【发布时间】:2019-11-11 18:10:15
【问题描述】:

我想对 Crystal Report 中的一列求和,但是当该列为空时,它不显示 sum = 0

这是公式

if isnull(Sum ({VSalesIncome.TotalPrice}))
then 0
else
Sum ({VSalesIncome.TotalPrice})

这是错误

error in Formula Sum Price :
isnull(Sum ({VSalesIncome.TotalPrice}))
A number field or currency amount field is required here 
Details errorkind: 

【问题讨论】:

    标签: crystal-reports sum


    【解决方案1】:

    Sum 忽略 null 值,所以只需 sum...

    或者,如果您坚持检查 null,请使用详细级别公式:

    if isnull({VSalesIncome.TotalPrice}) then 0 else {VSalesIncome.TotalPrice}
    

    然后对这个公式求和。

    【讨论】:

    • 公式中找不到总和
    • 当价值总和价格为空时,公式总和价格中显示 erorr 错误:如果 isnull({VSalesIncome.TotalPrice}) then 0 else {VSalesIncome.TotalPrice} 这里需要一个数字,详细信息错误种类跨度>
    • 听起来 {VSalesIncome.TotalPrice} 不是数字。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-31
    • 1970-01-01
    相关资源
    最近更新 更多