Visual Studio 2008报表设计器(复杂总账)
我正在合并报告以创建一个总账报告,目前它由 84 个单独的报告组成。我的想法是最终用户将有一个部门和月份的下拉列表。这些是我的专栏:
帐号 帐户描述 当前期间 实际
年初至今 实际年初至今预算 年初至今预算差异
总年度预算 帐户状态
我已经弄清楚了大部分内容,但无法理解如何计算年初至今实际和年初至今预算,因为这些需要多个字段的总和取决于选择的月份和部门。
我的 where 语句是这样的,并处理当前期间的实际值和帐号
: ( gl_master.acct_cde = gl_master_comp_v.acct_cde ) 和
( gl_master.budget_officer =budget_off_mstr.budget_officer ) 和
( ( gl_master_comp_v.acct_comp1 = '01' ) 和
(budget_off_mstr.budget_officer IN (@BudgetOfficer))) 和 ((@Month = 1 AND gl_master.post_bal_mon_1) 或 (@Month = 2 AND gl_master.post_bal_mon_2)...
当有多个字段被求和时,如何让查询识别需要放入列中的内容。
感谢您的任何见解。如果您之前做过类似的事情,那么它的一小部分样本将会非常有帮助。
I'm combining reports to create a single general ledger report, currently it consists of 84 seperate reports. My idea is the end user will have a drop down for the department and month. These are my columns:
Account Number Account Description Current Period Actual
YTD Actual YTD Budget YTD Budget Variance
Total YR Budget Account Status
I have most of it figured out, but can't understand how to figure YTD Actual and YTD Budget since these will require a Sum of multiple Fields depending on what month and department is selected.
My where statement goes something like this and takes care of the current period actual and account number:
Where
( gl_master.acct_cde = gl_master_comp_v.acct_cde ) and
( gl_master.budget_officer = budget_off_mstr.budget_officer ) and
( ( gl_master_comp_v.acct_comp1 = '01' ) AND
( budget_off_mstr.budget_officer IN (@BudgetOfficer) ) ) AND
((@Month = 1 AND gl_master.post_bal_mon_1) OR
(@Month = 2 AND gl_master.post_bal_mon_2)...
How can I have the query recognize what needs to be put into the column when there are multiple fields being summed.
Thanks for any insight. If you made something like this before a small sample of it would be very helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了。
它需要在数据集中的计算字段中完成。然后可以对文本框中的字段进行求和。
计算字段的一小块:
总和的文本框(我将其放在页脚中):
I worked it out.
It needs to be done in a calculated field within the dataset. Then a sum can be done on the field in the textbox.
small chunk of calculated field:
textbox for sum(I place this in footer):