Cannot Group Report (1 Viewer)

ErinL

Registered User.
Local time
Today, 07:48
Joined
May 20, 2011
Messages
118
Hello - I am using Access 2010 and have a report that uses the following query:

SELECT t.CountOfCategory, t.Category, t.CountOfDescription, t.Description
FROM qryTopThreeCategoryBehaviors AS t
WHERE (((t.Description) In (SELECT TOP 3 Description
FROM qryTopThreeCategoryBehaviors
WHERE Category=t.Category
ORDER BY CountOfDescription DESC
)));

The report runs fine using the query alone but when I try to group the report on the Category field I get the following error message:

This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements.Try simplifying the expression by assigning parts of the expression to variables.

Can someone please tell me why I am getting that and how I can group this report?

Thank you!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:48
Joined
May 7, 2009
Messages
19,230
why not use the original qryTopThreeCategoryBehaviors. as the query name suggest, its already has the top three records.
 

ErinL

Registered User.
Local time
Today, 07:48
Joined
May 20, 2011
Messages
118
Within each category there are multiple descriptions. For this report, the user wants the top three categories along with each of their top three descriptions both including their counts.

When I run the query I get the correct information but it looks like this:

CountOfCategory Category CountOfDescription Description
20 Trip Hazard 5 Stepped over plts
20 Trip Hazard 4 Moved item w/ ft
20 Trip Hazard 4 Moved plts w/ ft
10 Ergonomic 3 Improper bending
10 Ergonomic 2 Over-extended
10 Ergonomic 1 Improper lift
4 Equipment 5 Parking violation
4 Equipment 3 Travel violation
4 Equipment 2 Forks tilted

When I run the report I was hoping to group by Category so that the first two columns shown above are grouped into one line with the CountOfDescription and Description below it. It is really just to clean up the report view and remove the repeated lines.
 

Users who are viewing this thread

Top Bottom