【发布时间】:2018-07-26 23:19:16
【问题描述】:
鉴于以下客户的交易(发票和贷项通知单)
DocType OrigDocAmt CustomerID
------- -------------- -----------
CRM 100 10278
CRM 150 10278
CRM 75 10278
INV 200 10278
我需要得到总金额。考虑到INV应该是负数
select sum(case when DocType = 'INV' then -OrigDocAmt else OrigDocAmt end) TheTotal from
ARRegister where CustomerID=10278
TheTotal
---------------------------------------
125
如何编写聚合 BQL 来做到这一点?我不能只调用 Sum,因为它会给我 525。
提前致谢!
【问题讨论】:
标签: acumatica