expression - sql reporting builder 2008 r2 - how to SUM specific field

℡╲_俬逩灬. 提交于 2019-12-11 19:47:44

问题


i have generated a table below:

No Product A|No Product B|No Product C|No Product D|total Product A+D|total Product B+D
    100           50           30           40               ?                  ?       

in my first result, i wish to get the sum of total product A & D, follow by total product B + D, and expression code can sum it accordingly ?


回答1:


Again this is very simple , All you need is two expressions in your columns , it is just adding up two column. like you would do in sql server or any other RDBMS.

Add Two Columns to right of your existing columns and right click the data cell go to expression and use the following expressions to get the desired sum values.

total Product A+D

= Fields!ProductA.Value + Fields!ProductD.Value

total Product B+D

= Fields!ProductB.Value + Fields!ProductD.Value

I am only assuming the names of fields here, you will need to use the field name from your dataset. i.e Fields!YourFieldName.Value



来源:https://stackoverflow.com/questions/23457869/expression-sql-reporting-builder-2008-r2-how-to-sum-specific-field

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