unapplied receipts script based on as on date
hi all,
does anyone have unapplied receipts script based on as on date(11i), you can share r12 script also.
I tried making script but its not working(I am non-techincal)
select a.cash_receipt_id,
a.receipt_number,
CURRENCY_CODE,
c.customer_name,
c.customer_number,
a.amount orginal_rec_amt,
a.exchange_rate,
(a.amount - (select nvl(sum(amount_Applied), 0)
from ar_receivable_applications_all
where status = 'APP'
and gl_date <= to_date('&ASONDATE', 'YYYY-MM-DD')
AND cash_receipt_id = a.cash_receipt_id)) unapplied_amt
from AR_CASH_RECEIPTS_ALL a, ar_payment_schedules_all b,ar_customers c