Featured post

Functionality of Segment Value Inheritance ESS Process

  The Segment Value Inheritance process simplifies the maintenance of the chart of accounts. When the characteristics of values in the value...

Monday 8 May 2017

SQL query to retrieve AP payments based on Creation date

Find below SQL Query to identify AP payments along with matched invoices based on Creation date:

select

a.DOC_SEQUENCE_VALUE Voucher_Num,
a.CHECK_NUMBER Payment_Doc_Num,
a.CHECK_DATE Payment_Date,
a.Amount,
a.CURRENCY_CODE Currency,
a.PAYMENT_METHOD_CODE Payment_Doc,
a.Bank_Account_Name,
a.Bank_Account_Num,
a.Vendor_Name,
c.segment1 Vendor_Num,
a.STATUS_LOOKUP_CODE Payment_Status,
a.Creation_Date,
b.user_NAME Created_By,

(SELECT
       listagg (INVOICE_NUM, ',') WITHIN GROUP (ORDER BY INVOICE_NUM)
       INVOICE_NUM
       FROM AP_INVOICE_PAYMENTS_V WHERE CHECK_ID=a.CHECK_ID)Invoice_Num

from
AP_CHECKS_ALL a,
FND_USER b,
AP_SUPPLIERS c

WHERE
trunc(a.CREATION_DATE)='02-Nov-16' and
--a.STATUS_LOOKUP_CODE != 'VOIDED' and
a.CREATED_BY=b.USER_ID and
a.VENDOR_ID=C.VENDOR_ID and
a.ORG_ID=82

order by b.USER_NAME

No comments:

Post a Comment

Please review my topic and update your comments

Note: only a member of this blog may post a comment.