Only had a very quick look as on my lunch but cant you seperate out the sub query an dthen call that query from inside this one? should allow you to have the group by in the initial query then
Main Topics
Browse All TopicsI am trying to generate an access report using a query that uses subquery select statements to get trends (SQL posted below). When I build and run a report on this query, I get the following error from Access:
Multi-level GROUP BY clause is not allowed in a subquery.
If I take out the 2 items in Sorting and Grouping, my report formatting is completely gone, but the report runs/formats. How can I get this to work and be able to group?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You can join various elements such as
select * from
mytable,
(select this,that,max(something) as "maxs" from somewhere group by somethingelse) t,
(select otherthins,max(somethingel
where mytable.column = t.maxs
and mytable.columnelse = e.maxe
etc etc...
Will "try" to unravel that very long line of your and see if I can re-package...
Access is sometimes acting a bit strange with report queries.
The Order By specified by you won't work as Access uses the Grouping for sorting and this will overrule your query's Order By....
When I can't get a query to run with a report I usually change it into an INSERT query and store the result in a temp table. The report is than base on that table.
Not nice, but will work always :-)
(Will of course require in your code before triggering the report a "DELETE * FROM tblReportTemp" and your query changed into an "INSERT" into tblReportTemp.
Nic;o)
Or a Make-Table query would override it.
I'm not against using that if I don't see any other solutions on how to get this to work. I will have the ability to use this as I am the only person that will be manipulating the data. I am currently feeding everything into an Excel file and using a lot of VBA to format everything.
The Make-Table query will issue an error as the table will exist the second time you run it. So a DROP TABLE will be needed before executing the Make-Table.
Normally I use a Make-Table query the first time and (with small tables) a DELETE *.
For larger tables you're better off with the DROP/CREATE Table solution.
You might try to use instead of the sub-queries a DMAX() like:
DMAX("CountOfpddt_policy_n
Assuming the pddt_destination_cd field is text.
The DMAX()/DMIN/etc. functions are however slooow.
Nic;o)
Nic;o)
Business Accounts
Answer for Membership
by: SeanStricklandPosted on 2008-05-09 at 04:16:15ID: 21531678
I am Sorting/Grouping by:
dccd_dept ASC
pddt_destination_cd ASC
SnapshotDate ASC
SQL:
Select allOpen in new window