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

Monthly Cumulative Reports

P: 1
Hello from Nova Scotia Canada.

Hi there, Im struggling a bit here and I thought I might seek out some advice. Nice to meet you all.

My situation is that im running a database that records events related to the manufacturing process in our company. Everytime a specific event is logged, there is a date mm/dd/yyyy associated with that. What I'm trying to do is do a monthly report that counts the number of individual events within a given month, groups them together (ie: February), then shows a bar chart showing the number of occurances per month.

I will use a date peramater so they decide how many months are to show up on the report. The trouble is that I dont know how to group the dates into months, then report monthly.

Any advice?

Thanks,

Steve
Oct 17 '07 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
Hi Steve

To get the Month number of a date you can use the Month() Function.

Month([DateField])

To get the Month name use MonthName()

You can then count the result. Your query would be something like...

Expand|Select|Wrap|Line Numbers
  1. SELECT EventName, MonthName([DateField]), Count([DateField) As NumEvents
  2. FROM TableName
  3. GROUP BY EventName, MonthName([DateField]);
  4.  
Oct 17 '07 #2

Post your reply

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