【问题标题】:SUM of 2 Columns using Crystal Report in VB.NET在 VB.NET 中使用 Crystal Report 的 2 列的总和
【发布时间】:2015-01-20 09:49:59
【问题描述】:

我的表名是“accounting”

它有两列名为“借方”和“贷方”

这两列的总和可以吗?

示例:

输入: 借记卡信用卡 200 + -100 300 + -300 500 + -400 -------- ---------- 1000 -800

我希望它在我的 Crystal Report 中显示如下:

借记贷记总计 200 -100 100 300 -300 0 500 -400 100 -------- ---------- --------- 1000 -800 200

我不知道应该在 Crystal Report 中使用什么公式

【问题讨论】:

    标签: sql-server vb.net crystal-reports


    【解决方案1】:

    如果你在 sqlserver 中添加一个带有摘要的列,那就太好了

    select 
        Debit, Credit, Debit+Credit as Total
    from yourtable
    

    如果你希望在水晶报表方面,那也是可以的。

    添加一个变量并将其写入如下,并放在该字段附近的详细信息部分。

    {@yourtablename.DebitField} + {@yourtablename.creditField} //I forgot the syntax, please change aproopriate.
    

    Adding Sum of fields of two tables giving strange result in Crystal Report

    http://vbcity.com/forums/t/154231.aspx

    【讨论】:

      猜你喜欢
      • 2013-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多