Ambiguous OUTER JOIN in query

sbraun27

New Member
Joined
Aug 22, 2016
Messages
8
Hello everyone!

I have a query in access (I did not build and has worked for 13 years) that all of a sudden is not working anymore and gives the "Your SQL query could not be executed because it contains ambiguous outer joins". I'm not very adept at SQL so I am struggling on fixing the issue. The query is:


Code:
SELECT TaxProxy_Account.[Checked On], TaxProxy_Account.Account, TaxProxy_Account.Sell_Fund_1, TaxProxy_Account.Sell_Fund_2, TaxProxy_Account.ProxyHurdle AS Hurdle, TaxProxy_Account.PercentSell_1, TaxProxy_Account.PercentSell_2, TaxProxy_Account.ProxyHurdle, TaxFactor_XTaxFactor_Sum.SumOfWeight, IIf((([PercentSell_1]/[SumOfWeight])*[SumOfXTaxFactor])>50,50,(([PercentSell_1]/[SumOfWeight])*[SumOfXTaxFactor])) AS Account_Factor, TaxFactor_XTaxFactor_Sum.SumOfXTaxFactor, [Hurdle]-[Account_Factor] AS Diff, TaxProxy_Account.[Review Date], TaxProxy_Account.Buy_Fund_1, TaxProxy_Account.Model

FROM TaxFactor_XTaxFactor_Sum AS TaxFactor_XTaxFactor_Sum_1, TaxProxy_Account LEFT JOIN TaxFactor_XTaxFactor_Sum ON (TaxProxy_Account.Account = TaxFactor_XTaxFactor_Sum.[Portfolio Account Number]) AND (TaxProxy_Account.[Sell_Fund_1] = TaxFactor_XTaxFactor_Sum.Symbol);

Any help on rewriting this query would be greatly helpful.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
instead of SQL try putting it into a query. It may help.
Or try rebuilding the sql in a query from scratch. Your OUTER joins must happen to ALL joins. This error occurs when only 1 side of joins are outer, and others are inner.
 
Upvote 0
As far as I can tell, the only join is the left join in the FROM section. Is it a matter of a missing parentheses? I can't see anything that would lead to the join being ambiguous, and there aren't any outer joins in the statement.
 
Upvote 0
Your sql looks pretty garbled right now. Based on what you posted there is an entire table in the from clause that is not used in the query at all:

Code:
FROM 
[B][COLOR="#FF0000"]	TaxFactor_XTaxFactor_Sum AS TaxFactor_XTaxFactor_Sum_1, [/COLOR][/B]
	TaxProxy_Account 
		LEFT JOIN TaxFactor_XTaxFactor_Sum 
		ON (TaxProxy_Account.Account = TaxFactor_XTaxFactor_Sum.[Portfolio Account Number]) 
		AND (TaxProxy_Account.[Sell_Fund_1] = TaxFactor_XTaxFactor_Sum.Symbol);

So you can and should delete that whole line and make the from clause like this:
Code:
FROM 
	TaxProxy_Account 
	LEFT JOIN TaxFactor_XTaxFactor_Sum 
	ON (TaxProxy_Account.Account = TaxFactor_XTaxFactor_Sum.[Portfolio Account Number]) 
	AND (TaxProxy_Account.[Sell_Fund_1] = TaxFactor_XTaxFactor_Sum.Symbol);

... unless there is some weird reason for that to be there that I don't understand right now.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,388
Messages
6,119,227
Members
448,878
Latest member
Da9l87

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top