Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Posts
    6

    Unanswered: 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;

  2. #2
    Join Date
    Feb 2012
    Posts
    6
    If I eliminate the full outer join the error goes away. But I need it.

  3. #3
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •