Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Query Too Complex?

Posted on 2011-02-16
5
414 Views
Last Modified: 2012-05-11
Hello I have the following query in a Microsoft Access database:

SELECT Count(*) AS Total_Record, Sum(IIf([Reprint Edition] Like 'get*',1,0)) AS Eligible, Sum(IIf([Reprint Edition] Like 'get*' And [Reviewed Item] Like 'exc*',1,0)) AS FT_Excluded, Sum(IIf([Reprint Edition] Like 'dng*',1,0)) AS Excluded, Sum(IIf([Reviewed Item] Like 'inc*',1,0)) AS FT_Included, Sum(IIf([Reprint Edition] Is Null,1,0)) AS RE_Null, Sum(IIf([Notes] Is Null,1,0)) AS Notes_Null, Sum(IIf([Reprint Edition] Like UNC,1,0)) AS RE_UNC

After adding "Sum(IIf([Reprint Edition] Like UNC,1,0)) AS RE_UNC"
I am getting the error that the 'Query Is Too Complex'.  I'm not really sure what this means nor do I know how to fix it.  Can anyone help?

Bevo
0
Comment
Question by:Bevos
  • 2
  • 2
5 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 350 total points
ID: 34910311
http://allenbrowne.com/subquery-02.html
Error: "Query too complex"
JET gives this generic message any time it cannot pinpoint what's wrong. The cause can be wrong delimiters, misinterpreted data types, mismatched brackets, using reserved words as table or field names or aliases, confusion from Name AutoCorrect, or a host of other possibilities.

Is UNC really a column, or did you mean to quote it (as a string) in "Sum(IIf([Reprint Edition] Like UNC,1,0)) AS RE_UNC" ?
0
 

Author Comment

by:Bevos
ID: 34910392
Hi cyberkiwi, unc is field value for [Reprint Edition].  I tried to change it to "Sum(IIf([Reprint Edition] Like 'UNC*',1,0)) AS RE_UNC;" but that does not work as well.
0
 
LVL 21

Assisted Solution

by:Boyd (HiTechCoach) Trimmell, Microsoft Access MVP
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 150 total points
ID: 34910421
It would help to see the complete SQL statement.

Is there only one table or query in the FROM clause?

0
 

Author Comment

by:Bevos
ID: 34910481
Haha, I'm an idiot. I didn't include the FROM cause.  I'm gonna give you both some points and my God have mercy on my soul.

Bevo
0
 
LVL 21
ID: 34910501
Glad we could assist.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question