Good Afternoon,
I am having hard time trying to left outer join tables. The problem is this. I have five tables a, b, c, d, e. I need to join a to b a to c a to d and then b to e. the minute I try to do b to e join, query stops working. Below is the SQL I was attempting to use. Thank you very much for your help.
select a.Costcenter_cd,a.Costcenter_nm, a.Accnt_cd,a.Accnt_nm,a.Document_no,a.Document_type,a.Posting_day,a.Posting_month,a.Posting_Year,
a.Internal_order,a.Offset_Accnt,
a.Offset_accnt_type,a.offset_accnt_nm,a.amt_usd,a.amt_trans_curr,a.trans_curr,a.amt_entity_curr,a.entity_curr,a.PO_num,a.PO_Requisitioner,a.FI_DOC_NUM,
b.header_txt,b.ref_key1,b.ref_key2,b.sap_reference,b.sap_reference_key, c.proj_desc,c.dvlpmt_cmpnd_id,a.subarea_code,d.Subarea_desc,a.dtstamp,e.Grant_Type_NM as GMS_Grant_Type,
e.Grant_ID as GMS_Grant_ID,E.INVOICE_NBR as GMS_Invoice_Number,e.payment_method_nm as GMS_Pmt_Method,e.check_nbr as GMS_Check_Num,e.Requester_NM as GMS_Requester
from dw_grnt_trans_YtD a
left outer join financial.dw_grnt_finref_ytd b on A.FINREF_KEY=b.unique_key
left outer join financial.eproject_full_view c on A.INTERNAL_ORDER=C.PROJ_ID
left outer join financial.ref_sap_merck2hier d on A.SUBAREA_CODE=D.SUBAREA
left outer join financial.gms_pymnt_dtls_vw e on B.HEADER_TXT=E.PAYMENT_ID
where a.subarea_code in(upper(:Subarea)) or
a.Costcenter_cd in(:Cost_Center) and
to_date(a.posting_month||'/'||a.posting_day||'/'||a.posting_year,'mm/dd/yyyy')
between (:Start_Date) and
(:End_Date)