Carrying out a SUMIF like operation using SQL Server Report Builder

一笑奈何 提交于 2019-12-01 02:53:05
praveen

The data type of the column 'kWp' is Decimal so you need to either convert the default value to 0.00 or cast the column to double

 SUM(iif(Fields!ProjectTypeID.Value = 2,cdbl(Fields!kWp.Value),0.00))
Venaikat

To get the sum of the kWp of all projects of type 2, the expression is as follows,

=IIf(Fields!ProjectTypeID.Value=2,sum(Fields!kWp.Value),0) 

I hope this will help u.

Ghayour Khan

To get the conditional sum you can try this expression

=sum(IIf(Fields!balance.Value > 0,(Fields!balance.Value),0))

It sums only positive numbers otherwise it adds 0 to the total, you can do it wise versa.

I had similar problem, this worked for me:

=Sum(iif(Fields!date_break.Value = "0001-01-01",Fields!brkr_fee.Value, nothing))

zb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!