English 中文(简体)
水晶报表总结
原标题:
  • 时间:2009-05-12 18:42:07
  •  标签:

So I two groups tblTenant.ID tblTransaction.TenantID

在tblTransactions有两个领域我想操纵,AmountCharged AmountPaid。我怎么能和字段和减去他们每组?即,每个租户将他们所有的amountCharged总结,然后有他们AmountPaid年代总结和减去。

例如,SQL将:

SELECT SUM(tblTransactions.AmountCharged) - SUM(tblTransactions.AmountPaid) FROM tblTransactions
Where tblTrascactions.TenantID = x

其中x是租户id。

最佳回答

我能想到的最简单的方法是创建一个公式字段在细节AmountCharged-AmountPaid并使其隐藏线。然后右键单击它并插入一个金额。

问题回答

可以用一个晶体公式……

SUM({tblTransactions.AmountCharged}, {tblTrascactions.TenantID}) - 
SUM({tblTransactions.AmountPaid}, {tblTrascactions.TenantID})

SUM({tblTransactions.AmountCharged} - {tblTransactions.AmountPaid}, {tblTrascactions.TenantID}) 

then display that f或mula in the tenantID group footer.





相关问题
热门标签