Oracle EBS-SQL (AR-1):检查应收收款发生额

SELECT SUM(nvl(dist.amount_dr,0))-SUM(nvl(dist.amount_cr,0))
FROM ar_cash_receipt_history_all hist,
         ar_distributions_all dist
WHERE hist.cash_receipt_history_id = dist.source_id
-- AND hist.status = 'REVERSED'
    AND hist.gl_date BETWEEN TO_DATE('2004-04-29','yyyy-mm-dd') AND TO_DATE('2004-05-28','yyyy-mm-dd')
-- AND ABS(NVL(DIST.AMOUNT_DR,0)-NVL(DIST.AMOUNT_CR,0))=147300
-- AND HIST.CASH_RECEIPT_ID = 143283

转载于:https://www.cnblogs.com/st-sun/p/3778130.html

你可能感兴趣的:(Oracle EBS-SQL (AR-1):检查应收收款发生额)