SQL Error with outer joins
-
- Posts: 3
- Joined: Tue Oct 10, 2017 12:44 pm
SQL Error with outer joins
"Query contains an outer-join request that is not permitted"__I am getting this SQL error when I create a Left Join to a database, and a second Left Join to a database off the first database.__I believe it has something to do with the way the SQL query is being built. Is there any way around this in R&R?____This is the query that is being built:____********************__select__ V_Enhan.IsVoided, V_Enhan.BillingProfileKey, V_Enhan.CustomerKey, V_Enhan.OrderKey, V_Enhan.WeekEnding, V_Enhan.PayBillCode, V_Enhan.BPProfitCenterKey, V_Enhan.DYNHEAD_INVCNMBR, V_Enhan.DYNHEAD_CUSTNMBR, V_Enhan.DYNHEAD_CSTPONBR, V_Enhan.DYNHEAD_DOCDATE, V_Enhan.DYNHEAD_PYMTRMID, V_Enhan.DYNHEAD_DOCAMNT, V_Enhan.DYNHEAD_TAXAMNT, V_Enhan.DYNLINE_QUANTITY, V_Enhan.DYNLINE_XTNDPRCE, V_Enhan.DYNLINE_UNITPRCE, V_Enhan.DYNLINE_SALSTERR, V_Enhan.DYNLINE_ITEMDESC, TakenCon.Last_Name, TakenCon.Address1, TakenCon.Address2, TakenCon.City, TakenCon.StateCode, TakenCon.PostalCode, OrderMa.OrderType, BillTo.First_Name, BillTo.Last_Name, BillTo.Address1, BillTo.Address2, BillTo.City, BillTo.StateCode, BillTo.PostalCode, Divisio.Division_Name, Custome.ProfitCenterKey, portal_a.confirmation_code, Supervis.First_Name, Supervis.Last_Name, Supervis.Address1, Supervis.City, Supervis.StateCode, Supervis.PostalCode, CFG_BRAN.Phone__ from __dbo.V_EnhancedInvoiceDYN V_Enhan, dbo.ContactMaster TakenCon, dbo.OrderMaster OrderMa, dbo.ContactMaster BillTo, dbo.DivisionMaster Divisio, dbo.CustomerBillingProfile Custome, dbo.portal_timecards portal_t, dbo.portal_timecards_audit portal_a, dbo.ContactMaster Supervis, dbo.CFG_BRANCHPROFILE CFG_BRAN __where__ V_Enhan.DivisionKey *= TakenCon.Contact_ID __and V_Enhan.OrderKey = OrderMa.Order_ID __and OrderMa.StartContactKey *= BillTo.Contact_ID __and V_Enhan.DivisionKey = Divisio.Division_ID __and V_Enhan.BillingProfileKey = Custome.BillingProfileKey __and V_Enhan.AssignmentKey *= portal_t.assignment_id and V_Enhan.WeekEnding *= portal_t.weekending __and portal_t.timecard_id *= portal_a.timecard_id and portal_t.status *= portal_a.status __and OrderMa.SupervisorContactKey *= Supervis.Contact_ID __and Custome.ProfitCenterKey = CFG_BRAN.Branch_ID __and ((V_Enhan.CustomerKey not in (^0000271T^,^000021D1^,^00002081^,^0000298F^,^000020T2^,^000033HM^,^000028TD^,^000022HR^,^00002LHR^,^00002R21^) and V_Enhan.BillingProfileKey <> ^0000211B^ and V_Enhan.DYNLINE_QUANTITY > 0 and V_Enhan.IsVoided <> 1 and Custome.ProfitCenterKey >= ^4500^)) __order by__ Custome.ProfitCenterKey, V_Enhan.DYNHEAD_INVCNMBR, V_Enhan.EMNameLastFirst, V_Enhan.PayBillCode__********************************____This is the 2nd join that is causing the issue.____portal_t.timecard_id *= portal_a.timecard_id and portal_t.status *= portal_a.status____Thanks,__Craig__