By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,853 Members | 2,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,853 IT Pros & Developers. It's quick & easy.

How do I sort by a Count?

P: n/a
Application reads information from a barcode scanner, to
track daily FedEx/Ups/Etc receipts at a loading dock

One of the reports is a daily summary, using a query to
select information between dates, and then producing a
summary count, by date, for all receipts in the range

This all works perfectly, based on =Count([DateStamp])
in the "DateStamp Footer" (for example)
73 3/20/2007
84 3/19/2007
35 3/16/2007
and so on...

What I would like to do now is create a new report, which
will sort based on the count itself, to give me...
84 3/19/2007
73 3/20/2007
35 3/16/2007

Problem is, all I get is an error message that using a count
in the sort field is not allowed

Any ideas? John
Mar 20 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Mar 20, 6:23 pm, John Thomas Smith <jtsm...@pacifier.comwrote:
Application reads information from a barcode scanner, to
track daily FedEx/Ups/Etc receipts at a loading dock

One of the reports is a daily summary, using a query to
select information between dates, and then producing a
summary count, by date, for all receipts in the range

This all works perfectly, based on =Count([DateStamp])
in the "DateStamp Footer" (for example)
73 3/20/2007
84 3/19/2007
35 3/16/2007
and so on...

What I would like to do now is create a new report, which
will sort based on the count itself, to give me...
84 3/19/2007
73 3/20/2007
35 3/16/2007

Problem is, all I get is an error message that using a count
in the sort field is not allowed

Any ideas? John

Sorting in a query is allowed so I'm not sure what you are doing
differently.

Example

SELECT Table.PRODUCT, Count(Table.PRODUCT) AS CountOfPRODUCT
FROM Table
GROUP BY Table.PRODUCT
ORDER BY Count(Table.PRODUCT) DESC;

Mar 20 '07 #2

P: n/a
John,

Put the alias (such as EXPR1) in the sort box. Or generate the query in SQL
view.

-- Bill

"John Thomas Smith" <jt*****@pacifier.comwrote in message
news:hb********************************@4ax.com...
Application reads information from a barcode scanner, to
track daily FedEx/Ups/Etc receipts at a loading dock

One of the reports is a daily summary, using a query to
select information between dates, and then producing a
summary count, by date, for all receipts in the range

This all works perfectly, based on =Count([DateStamp])
in the "DateStamp Footer" (for example)
73 3/20/2007
84 3/19/2007
35 3/16/2007
and so on...

What I would like to do now is create a new report, which
will sort based on the count itself, to give me...
84 3/19/2007
73 3/20/2007
35 3/16/2007

Problem is, all I get is an error message that using a count
in the sort field is not allowed

Any ideas? John

Mar 20 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.