Re: Query Too Complex
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Thu, 18 Aug 2005 22:42:14 +0800
How many grouping levels do you need?
>From memory, the limit is about 9.
Is it failing with fewer than that?
If so, what data types are in use at each level?
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Adam" <Adam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AFEC7D8E-0A68-4523-8F16-7F952948B899@xxxxxxxxxxxxxxxx
> Many thanks for this Allen, it is very useful.
>
> The biggest problem I have is the report not running when it is based
> directly on a table. The only solution I had to this was to remove some of
> the grouping levels, however this is by no means ideal.
>
> Do you know of anything I can do to make this report run with the number
> of
> grouping levels I want?
>
> Thanks again,
>
> Adam.
>
>
>
>
> "Allen Browne" wrote:
>
>> The 'Query too complex' message means that Access is not able to
>> interpret
>> how to run the query. (If the report is based directly on a table, that
>> could include the query that the report itself creates in order to
>> perform
>> the Sorting And Grouping you requested.)
>>
>> The functionality has not been reduced since A97, so the fact that the
>> same
>> thing worked there indicates that the query is not too complex.
>>
>> However, JET 4 (the query engine in Access 2000 and later) is certainly
>> poorer at understanding the data types of calculated query fields, and it
>> generates this error when it gets confused about how to apply criteria or
>> if
>> the types don't match. It is highly likely that this is the cause or the
>> problem with the UNION query, and probably the others as well.
>>
>> The solution is to explicitly typecast the calculated fields in the
>> query.
>> For details, see:
>> Calculated fields misinterpreted
>> at:
>> http://allenbrowne.com/ser-45.html
>>
>> The article should also encourage you to declare any parameters in your
>> queries. For example, if your OrderID field has this in the Criteria row:
>> [Forms].[Form1].[OrderID]
>> then choose Parameters on the Query menu (in query design), and in the
>> dialog enter:
>> [Forms].[Form1].[OrderID] Long
>>
>> For the UNION query, the data type is determined from the first SELECT
>> statement, so if you have:
>> SELECT ID, Null As Expr1 FROM ...
>> then the 2nd field will be intrepreted as text, regardless of the data
>> type
>> of the 2nd column in the 2nd SELECT. To avoid that, reverst the
>> statements,
>> typecast the field, or use this fudge to get it interpreted as a number:
>> SELECT ID, IIf(False, 0, Null) As Expr1 FROM ...
>>
>> "Adam" <Adam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:34BDB988-09D9-46A3-8682-A23A148CFD33@xxxxxxxxxxxxxxxx
>> >
>> > My organisation has recently upgraded from Access97 to Access2002 and
>> > many
>> > of the reports I built in Access97 no longer work. The error message
>> > 'Query
>> > too Complex' is always returned - even if the report is based on a
>> > table.
>> >
>> > I wonder if microsoft have reduced to number of functions reports can
>> > handle
>> > as these reports are quite complex, they have many levels and the
>> > controls
>> > can contain more than one function.
>> >
>> > When i reduce the number of controls on the report the report does run,
>> > however this not an ideal solution. I wondered if anyone else had
>> > encountered
>> > this problem and knew a work around. It seems that in terms of report
>> > complexity microsft have taken a step backward from 97 to 2002.
>> >
>> > I also have the same problem running a very simple report that is based
>> > on
>> > a
>> > union query.
>> >
>> > Any help would be greatly appriecated.
>> >
>> > Many thanks,
>> >
>> > Adam.
.
- Follow-Ups:
- Re: Query Too Complex
- From: Adam
- Re: Query Too Complex
- References:
- Query Too Complex
- From: Adam
- Re: Query Too Complex
- From: Allen Browne
- Re: Query Too Complex
- From: Adam
- Query Too Complex
- Prev by Date: Deleting blank Pages
- Next by Date: Report to Snapshot Export Error?
- Previous by thread: Re: Query Too Complex
- Next by thread: Re: Query Too Complex
- Index(es):
Relevant Pages
|