Monday, May 8, 2017

Query To Get Project Draft Invoice Details

SELECT
C.segment1 PROJECT_NUMBER,
C.NAME PROJECT_NAME,
carrying_out_organization_name PROJECT_ORGANIZATION,
c.project_type,
ra_invoice_number,
SUM(inv_amount) INVOICE_AMOUNT

FROM
pa_draft_invoice_lines_all_v a,
pa_draft_invoices_all b,
pa_projects_cust_360_v c

WHERE A.PROJECT_ID = B.PROJECT_ID
AND a.DRAFT_INVOICE_NUM = b.DRAFT_INVOICE_NUM
AND a.PROJECT_ID = c.PROJECT_ID
AND b.PROJECT_ID = c.PROJECT_ID
AND c.project_type IN ('Your Project Types')
--AND CARRYING_OUT_ORGANIZATION_NAME LIKE 'Organization Name%'
--and project_number = '&PROJECT_NUMBER'

GROUP BY
C.segment1,
C.NAME,
carrying_out_organization_name,
c.project_type,

ra_invoice_number

No comments:

Post a Comment

Best Blogger TipsGet Flower Effect