Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Crystal reports 对Crystal Report中的列求和,当为空时求和=0_Crystal Reports_Sum - Fatal编程技术网

Crystal reports 对Crystal Report中的列求和,当为空时求和=0

Crystal reports 对Crystal Report中的列求和,当为空时求和=0,crystal-reports,sum,Crystal Reports,Sum,我想对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 fie

我想对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: 

求和忽略空值,所以只需求和

或者,如果坚持检查null,请使用详细程度公式:

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

然后对公式求和。

公式中找不到sum,当值sum price为null时,在公式sum price中显示erorr erorr:如果为null({VSalesIncome.TotalPrice}),则0其他{VSalesIncome.TotalPrice}这里需要一个数字,详细信息错误听起来像{VSalesIncome.TotalPrice}不是数字。