on 08-17-2016 8:50 AM
Hi guys,
I have this query that gets the outstanding balances per business partner (customers) and orders them in descending. Where I'm stuck is how to sum all these balances together to give me one total value at the end. The following is the query:
SELECT T0.[CardName], case when T0.[Currency] = 'USD' THEN T0.[BalanceFC] else T0.[BalanceSys] end AS 'Balance' FROM OCRD T0
WHERE T0.[CardType] ='C' and T0.[BalanceSys] >'0' and T0.[BalanceFC] >'0' ORDER BY T0.[BalanceSys] DESC
I tried to use SUM() but it just copies the values to a new field and doesn't give me what I'm expecting.
Any help will much be appreciated. Thanks.
- Macdonald
Hi Macdonald,
A couple of things:
Regards,
Johan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much, I can work with this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
12 | |
10 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.