Query to find Credit Memos on an AP invoice
SELECT COUNT (DISTINCT ai2.invoice_num), ai1.invoice_num
FROM ap.ap_invoices_all ai1,
ap.ap_invoice_distributions_all aid1,
ap.ap_invoices_all ai2
WHERE ...28 posts
SELECT COUNT (DISTINCT ai2.invoice_num), ai1.invoice_num
FROM ap.ap_invoices_all ai1,
ap.ap_invoice_distributions_all aid1,
ap.ap_invoices_all ai2
WHERE ...SELECT COUNT (DISTINCT d.segment1), a.invoice_num
FROM ap.ap_invoices_all A,
ap.ap_invoice_distributions_all b,
po.po_distributions_all C,
po.po_headers...SELECT AGREEMENT_ID,
COMMENTS,
CONS_BILLING_NUMBER,
CONVERSION_DATE,
CONVERSION_RATE,
CONVERSION_TYPE,
CREDIT_METHOD_FOR_ACCT_RULE,
CREDIT_METHOD_FOR_I...SELECT order_number,
ship_set_id,
set_id fullfillment_set_id,
COUNT (DISTINCT PAYMENT_TERM_ID)
FROM (SELECT ship_set_id,
order_number,
...