A97 How do I Group by a Count?

J

John

I track daily receipts at a mailroom / loading dock (use a
barcode scanner on boxes, then import data to MS Access 97)

For statistical reporting, I have a simple report that
reads the RECEIVE table, with grouping on the DateStamp
field, and which shows the total items received by date
using a text box with =Count([DateStamp]) in a grouping
footer (I removed all of the detail information)

This works perfectly to report to the boss
Count 34 7/16/2008
Count 67 7/15/2008
Count 45 7/14/2008 - and so on

What I would like to do (for me) is have a report that
sorted by the count, so I could have
Count 67 7/15/2008
Count 45 7/14/2008
Count 34 7/16/2008

I have never before tried to group by a calculation, and
I am just not able to figure out how to make this work

I read the help and "should" be able to create a Query
that creates a summed/counted output... but I can't get
that to work either

Help!
 
N

ND Pard

Use the following query as your desired reports Record Source:

SELECT Count(RECEIVE.DateStamp), RECEIVE.DateStamp
FROM RECEIVE
GROUP BY RECEIVE.DateStamp
ORDER BY Count(RECEIVE.DateStamp) DESC;

Hope this helps.
 
K

KARL DEWEY

You have to use the Sorting and Grouping in the report as it will ignore any
sorting in the query.
In design view click on menu VIEW - Sorting and Grouping, select your count
field.
 
J

John

Thanks... works perfectly!

Use the following query as your desired reports Record Source:

SELECT Count(RECEIVE.DateStamp), RECEIVE.DateStamp
FROM RECEIVE
GROUP BY RECEIVE.DateStamp
ORDER BY Count(RECEIVE.DateStamp) DESC;

Hope this helps.


John said:
I track daily receipts at a mailroom / loading dock (use a
barcode scanner on boxes, then import data to MS Access 97)

For statistical reporting, I have a simple report that
reads the RECEIVE table, with grouping on the DateStamp
field, and which shows the total items received by date
using a text box with =Count([DateStamp]) in a grouping
footer (I removed all of the detail information)

This works perfectly to report to the boss
Count 34 7/16/2008
Count 67 7/15/2008
Count 45 7/14/2008 - and so on

What I would like to do (for me) is have a report that
sorted by the count, so I could have
Count 67 7/15/2008
Count 45 7/14/2008
Count 34 7/16/2008

I have never before tried to group by a calculation, and
I am just not able to figure out how to make this work

I read the help and "should" be able to create a Query
that creates a summed/counted output... but I can't get
that to work either

Help!
 

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