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

  • Thread starter Thread starter Ladi
  • Start date Start date
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
 
Have you used the Sorting/Grouping Toolbar button to select that group
level?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
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.
 
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
 
?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
 
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
 
Back
Top