Re: Multi-Level GROUP By Clause is not allowed in subquery
- From: Souris <Souris@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 25 Mar 2008 17:13:03 -0700
Thanks millions for the information,
Do you mean that I change select query to union query and at the end to
union all?
Does it work using union or must union all?
Thanks again,
"Marshall Barton" wrote:
Souris wrote:.
I use a query which includes subquery to generate my report, because they are
not in the same table.
I got "Multi-Level GROUP By Clause is not allowed in subquery" message when
I run the report.
MS Access lets me create the report using the query.
The query works fine when I run it.
Does MS Access report support subquery?
If not, any work around?
The problem with a subquery in a report's record source
happens when the report uses an aggregate function (Count,
Sum, etc) or has groups (via Sorting and Grouping). In this
case, the internally generated query that the report
actually uses adds additional GROUP BY clauses that breaks
in the presence of some(?) subqueries.
The standard workaround is to use a domain aggregate
function (DLookup, DCount, DSum, etc) instead of a subquery.
If that's not feasible, then the only other workaround I
know of is kind of ridiculous, but it has always worked for
me. Add this kind of glop to the end of your query:
UNION ALL
SELECT Null, Null, Null, Null, ...
FROM [a small table]
WHERE (some condition that is always false)
--
Marsh
MVP [MS Access]
- Follow-Ups:
- Re: Multi-Level GROUP By Clause is not allowed in subquery
- From: Marshall Barton
- Re: Multi-Level GROUP By Clause is not allowed in subquery
- References:
- Re: Multi-Level GROUP By Clause is not allowed in subquery
- From: Marshall Barton
- Re: Multi-Level GROUP By Clause is not allowed in subquery
- Prev by Date: Layout view
- Next by Date: Re: Only The Report Header Is Printing - No Data
- Previous by thread: Re: Multi-Level GROUP By Clause is not allowed in subquery
- Next by thread: Re: Multi-Level GROUP By Clause is not allowed in subquery
- Index(es):
Relevant Pages
|