Connecting Tech Pros Worldwide Forums | Help | Site Map

Group by Month

Big Time
Guest
 
Posts: n/a
#1: Nov 13 '05
I'm creating a report that tracks calls. Each call has a date when the call
was received. I want to create a report that groups and totals all records
in a given month, however I don't want the individual dates for calls to
show up. What I want to do is basically create a report that shows:

The name of the Month (based on the dates the calls were received)
Total calls

I can get the totals, however how do I get just the month to display?

Thanks.



rquintal@sympatico.ca
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Group by Month


Use the year([callreceivedDate]) function*100 plus the
month([callreceivedDate]) function in the underlying query. and group
on that number.

You can also add the month name from the
format([callreceiveddate],"mmmm") function
But that sorts April, December, February.....

King Ron
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Group by Month


In your query create an expression that calls the Format() function:

example - current month:

MonthName: Format(Now(),"mmmm")

example - where variable "MyDate" is a DateTime:

MonthName: Format([MyDate],"mmmm")

King Ron of Chi

Big Time
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Group by Month


> Use the year([callreceivedDate]) function*100 plus the[color=blue]
> month([callreceivedDate]) function in the underlying query. and group
> on that number.
>
> You can also add the month name from the
> format([callreceiveddate],"mmmm") function
> But that sorts April, December, February.....
>[/color]

Thanks, that did the trick. I created two columns for the month, one so I
could get the long name and the other so I could sort on the numerical value
since as you said, it sorted April, December, February.


Bob Quintal
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Group by Month


"Big Time" <big-time-grizz@remove-for-spam-hotmail.com> wrote in
news:djr9o1$h0p$1@nntp.itservices.ubc.ca:
[color=blue][color=green]
>> Use the year([callreceivedDate]) function*100 plus the
>> month([callreceivedDate]) function in the underlying query.
>> and group on that number.
>>
>> You can also add the month name from the
>> format([callreceiveddate],"mmmm") function
>> But that sorts April, December, February.....
>>[/color]
>
> Thanks, that did the trick. I created two columns for the
> month, one so I could get the long name and the other so I
> could sort on the numerical value since as you said, it sorted
> April, December, February.
>[/color]

Hope you cottoned onto the reason for how I defined the numeric
month, to include the year, because after you have accumulated
52 weeks of data, your month totals will get messed up.




--
Bob Quintal

PA is y I've altered my email address.
Big Time
Guest
 
Posts: n/a
#6: Nov 13 '05

re: Group by Month


[color=blue]
>
> Hope you cottoned onto the reason for how I defined the numeric
> month, to include the year, because after you have accumulated
> 52 weeks of data, your month totals will get messed up.
>[/color]

I did, and I appreciate it. I added a year field as well and grouped on
year then month. Thanks again.


Closed Thread


Similar Microsoft Access / VBA bytes