Andrew
06/26/2021, 1:44 AMSELECT ACCOUNT.id AS acct_id,
ACCOUNT.acctnumber AS acct_code,
SUM(TransactionAccountingLine.netamount) AS acct_balance
FROM TRANSACTION,
ACCOUNT,
TransactionAccountingLine,
transactionLine
WHERE TransactionAccountingLine.ACCOUNT = ACCOUNT.ID(+)
AND transactionLine.TRANSACTION = TransactionAccountingLine.TRANSACTION
AND transactionLine.ID = TransactionAccountingLine.transactionline
AND TRUNC(TRANSACTION.trandate) <= TO_DATE('2021-01-31', 'YYYY-MM-DD')
AND TRANSACTION.ID = transactionLine.TRANSACTION
AND ACCOUNT.isinactive = 'F'
AND TRANSACTION.posting = 'T'
AND ACCOUNT.ID IS NOT NULL
AND ACCOUNT.issummary = 'F'
GROUP BY (ACCOUNT.id, ACCOUNT.acctnumber)
Marc Reicher
06/26/2021, 5:22 AMMarc Reicher
06/26/2021, 5:38 AMTransactionAccountingLine.netamount
You actually would want to use:
TransactionAccountingLine.amount
If you have subsidiaries held in different currencies, then the problem gets a lot more complicated.Anthony (NimbusLabs)
06/26/2021, 3:27 PMAnthony (NimbusLabs)
06/26/2021, 3:28 PM