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

How may I count rows by day?

P: 2
Dear fellows:

I need to automatically count the number of rows tha exists each day in a query. I have a field with the date (2006/10/19). And for each day we have certain amount of rows (items, suscriptors in our case)

From this I would need to generate a report with 2 fields:

a) date
b) number of items existing each day

Please help!!!

Daniel
Oct 12 '06 #1
Share this Question
Share on Google+
4 Replies


P: 9
Hi,

I just made up the column and table names, but would this work for you?

select OrderDate,count(*) from Orders
group by OrderDate
Oct 12 '06 #2

P: 2
Sorry, It doesn't work. Where and how exactly do I have to introduce this code?
Oct 12 '06 #3

P: 9
Sorry, It doesn't work. Where and how exactly do I have to introduce this code?
Have you run this query against your database directly to see if you get the desired result?
Oct 12 '06 #4

MMcCarthy
Expert Mod 10K+
P: 14,534
Open a query in design view then change the design button to show SQL. Paste in the following substituting your values for DateFieldName and TableName.

Select DateFieldName, count(*) As NoOfItems from TableName Group By DateFieldName;

You should then be able to generate a report on the query using the wizard.
Oct 14 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.