Solved

Query Too Complex?

Posted on 2011-02-16
5
433 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
[X]
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
  • 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

615 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