If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Expression is type incorrectly or is too complex to be evaluated

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-12-12, 16:28
Legion6789 Legion6789 is offline
Registered User
 
Join Date: Feb 2012
Posts: 6
Expression is type incorrectly or is too complex to be evaluated

I have a query made up of two subqueries. The subqueries run fine. In the master query I join the subqueries by ID and add an ORDER BY clause. But when I try to run it, I get the "too complex" error.

Here's the master query:

SELECT qryBusByCntrySTISub.Country AS CountrySTI, qryBusByCntrySTISub.STIEligible, qryBusByCntrySTISub.STIPool, qryBusByCntrySTISub.STISpend, qryBusByCntrySTISub.AverageSTI, qryBusByCntrySTISub.PofBaseSalary, qryBusByCntrySTISub.DNA, qryBusByCntrySTISub.PA, qryBusByCntrySTISub.SA, qryBusByCntrySTISub.E, qryBusByCntrySTISub.SE, qryBusByCntryBSRSub.Country AS CountryBSR, qryBusByCntryBSRSub.BSREligible, qryBusByCntryBSRSub.DiscretionaryBudget, qryBusByCntryBSRSub.DiscretionaryIncrease, qryBusByCntryBSRSub.AverageIncrease, qryBusByCntryBSRSub.YoYIncrease, qryBusByCntryBSRSub.YoYG10, qryBusByCntryBSRSub.Promotions,
(qryBusByCntrySTISub.Country + qryBusByCntryBSRSub.Country) AS Sorter
FROM qryBusByCntryBSRSub LEFT JOIN qryBusByCntrySTISub ON qryBusByCntryBSRSub.Country = qryBusByCntrySTISub.Country
UNION SELECT qryBusByCntrySTISub.Country AS CountrySTI, qryBusByCntrySTISub.STIEligible, qryBusByCntrySTISub.STIPool, qryBusByCntrySTISub.STISpend, qryBusByCntrySTISub.AverageSTI, qryBusByCntrySTISub.PofBaseSalary, qryBusByCntrySTISub.DNA, qryBusByCntrySTISub.PA, qryBusByCntrySTISub.SA, qryBusByCntrySTISub.E, qryBusByCntrySTISub.SE, qryBusByCntryBSRSub.Country AS CountryBSR, qryBusByCntryBSRSub.BSREligible, qryBusByCntryBSRSub.DiscretionaryBudget, qryBusByCntryBSRSub.DiscretionaryIncrease, qryBusByCntryBSRSub.AverageIncrease, qryBusByCntryBSRSub.YoYIncrease, qryBusByCntryBSRSub.YoYG10, qryBusByCntryBSRSub.Promotions,
(qryBusByCntrySTISub.Country + qryBusByCntryBSRSub.Country) AS Sorter
FROM qryBusByCntryBSRSub RIGHT JOIN qryBusByCntrySTISub ON qryBusByCntryBSRSub.Country = qryBusByCntrySTISub.Country
ORDER BY Sorter;
Reply With Quote
  #2 (permalink)  
Old 02-12-12, 16:37
Legion6789 Legion6789 is offline
Registered User
 
Join Date: Feb 2012
Posts: 6
If I eliminate the full outer join the error goes away. But I need it.
Reply With Quote
  #3 (permalink)  
Old 02-12-12, 17:47
Legion6789 Legion6789 is offline
Registered User
 
Join Date: Feb 2012
Posts: 6
I fixed it. I don't know why it worked though. It was due to some null values in the DB. Still don't understand why those null values are fine on an inner join or left join or right join, just not in a full outer join.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On