How to sort by a field which contains "Count(*)" values?

L

Ladi

Dear pros,

I have a report with 2 group levels.
I need to sort descending within 2nd group by a field named "tgr" which
contains [=Count(*)] values.

Help please!
Ladi
 
J

Jeff Boyce

Have you used the Sorting/Grouping Toolbar button to select that group
level?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

Duane Hookom

A field can't contain "=Count(*)". A control in a group or report header or
footer can contain a control source like "=Count(*)".

You can't sort/group in a report based on a derived aggregate from a header
or footer. You would need to create a totals query that calcs the aggregate
value and add the totals query to your report's record source. This will
make the aggregate value available in the report's record source to sort by.
 
L

Ladi

The answer is No because the field is not a member of the query!
It is created in the report.
===============================================
Jeff Boyce said:
Have you used the Sorting/Grouping Toolbar button to select that group
level?

Regards

Jeff Boyce
Microsoft Office/Access MVP


Ladi said:
Dear pros,

I have a report with 2 group levels.
I need to sort descending within 2nd group by a field named "tgr" which
contains [=Count(*)] values.

Help please!
Ladi
 
J

Jeff Boyce

?Add it to the query?

Regards

Jeff Boyce
Microsoft Office/Access MVP


Ladi said:
The answer is No because the field is not a member of the query!
It is created in the report.
===============================================
Jeff Boyce said:
Have you used the Sorting/Grouping Toolbar button to select that group
level?

Regards

Jeff Boyce
Microsoft Office/Access MVP


Ladi said:
Dear pros,

I have a report with 2 group levels.
I need to sort descending within 2nd group by a field named "tgr" which
contains [=Count(*)] values.

Help please!
Ladi
 
L

Ladi

Thanks a lot!

Duane Hookom said:
A field can't contain "=Count(*)". A control in a group or report header or
footer can contain a control source like "=Count(*)".

You can't sort/group in a report based on a derived aggregate from a
header or footer. You would need to create a totals query that calcs the
aggregate value and add the totals query to your report's record source.
This will make the aggregate value available in the report's record source
to sort by.

--
Duane Hookom
MS Access MVP

Ladi said:
Dear pros,

I have a report with 2 group levels.
I need to sort descending within 2nd group by a field named "tgr" which
contains [=Count(*)] values.

Help please!
Ladi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top