A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Crosstab Query - Group by Month and Year



 
 
Thread Tools Display Modes
  #1  
Old March 12th, 2010, 09:25 PM posted to microsoft.public.access
Nate
external usenet poster
 
Posts: 181
Default Crosstab Query - Group by Month and Year

I've created a crosstab query that counts the number of calls per month. The
call field only contains a date. I've used that field as the column header
and chose to group it by month, but can't get it to seperate the months by
year. For instance all of March is grouped together whether it's March, 2009
or March, 2010. I'm pretty new to Access so I'm not familiar with SQL or
VBA. Any assistance would be greatly appreciated. Thanks,

Nate
Access 2003
  #2  
Old March 12th, 2010, 09:42 PM posted to microsoft.public.access
eggie
external usenet poster
 
Posts: 1
Default Crosstab Query - Group by Month and Year


"Nate" schreef in bericht
...
I've created a crosstab query that counts the number of calls per month.
The
call field only contains a date. I've used that field as the column
header
and chose to group it by month, but can't get it to seperate the months by
year. For instance all of March is grouped together whether it's March,
2009
or March, 2010. I'm pretty new to Access so I'm not familiar with SQL or
VBA. Any assistance would be greatly appreciated. Thanks,

Nate
Access 2003


  #3  
Old March 12th, 2010, 11:05 PM posted to microsoft.public.access
Bob Quintal
external usenet poster
 
Posts: 939
Default Crosstab Query - Group by Month and Year

=?Utf-8?B?TmF0ZQ==?= wrote in
:

I've created a crosstab query that counts the number of calls per
month. The call field only contains a date. I've used that field
as the column header and chose to group it by month, but can't get
it to seperate the months by year. For instance all of March is
grouped together whether it's March, 2009 or March, 2010. I'm
pretty new to Access so I'm not familiar with SQL or VBA. Any
assistance would be greatly appreciated. Thanks,

Nate
Access 2003


In the query design view, change the call field to a calculated field
based on Year(call) &"-" & Month(call)



--
Bob Quintal

PA is y I've altered my email address.
  #4  
Old March 13th, 2010, 01:57 AM posted to microsoft.public.access
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Crosstab Query - Group by Month and Year

I would use:
Format([Call],"yyyy-mm")

--
Duane Hookom
MS Access MVP

"Bob Quintal" wrote in message
...
=?Utf-8?B?TmF0ZQ==?= wrote in
:

I've created a crosstab query that counts the number of calls per
month. The call field only contains a date. I've used that field
as the column header and chose to group it by month, but can't get
it to seperate the months by year. For instance all of March is
grouped together whether it's March, 2009 or March, 2010. I'm
pretty new to Access so I'm not familiar with SQL or VBA. Any
assistance would be greatly appreciated. Thanks,

Nate
Access 2003


In the query design view, change the call field to a calculated field
based on Year(call) &"-" & Month(call)



--
Bob Quintal

PA is y I've altered my email address.


  #5  
Old March 13th, 2010, 12:19 PM posted to microsoft.public.access
Bob Quintal
external usenet poster
 
Posts: 939
Default Crosstab Query - Group by Month and Year

"Duane Hookom" wrote in news:6E839EBE-8B31-
:

I would use:
Format([Call],"yyyy-mm")

That works too, but somewhere I got the impression that
year([call] & "-" & month([call]) was marginally faster.


--
Bob Quintal

PA is y I've altered my email address.
  #6  
Old March 13th, 2010, 03:38 PM posted to microsoft.public.access
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Crosstab Query - Group by Month and Year

It might be marginally faster but I doubt you could tell unless your data
set is huge. My suggestion will format Jan as 01 with the leading 0. This
will sort the columns from left to right as you would expect to see them
2009-01, 2009-02,...2009-12 rather than 2009-1, 2009-10, 2009-11,... 2009-9.

--
Duane Hookom
MS Access MVP


"Bob Quintal" wrote in message
...
"Duane Hookom" wrote in news:6E839EBE-8B31-
:

I would use:
Format([Call],"yyyy-mm")

That works too, but somewhere I got the impression that
year([call] & "-" & month([call]) was marginally faster.


--
Bob Quintal

PA is y I've altered my email address.


  #7  
Old March 13th, 2010, 04:02 PM posted to microsoft.public.access
Bob Quintal
external usenet poster
 
Posts: 939
Default Crosstab Query - Group by Month and Year

"Duane Hookom" wrote in
:

It might be marginally faster but I doubt you could tell unless
your data set is huge. My suggestion will format Jan as 01 with
the leading 0. This will sort the columns from left to right as
you would expect to see them 2009-01, 2009-02,...2009-12 rather
than 2009-1, 2009-10, 2009-11,... 2009-9.


right.

--
Bob Quintal

PA is y I've altered my email address.
  #8  
Old March 13th, 2010, 05:28 PM posted to microsoft.public.access
De Jager
external usenet poster
 
Posts: 393
Default Crosstab Query - Group by Month and Year


"Nate" wrote in message
...
I've created a crosstab query that counts the number of calls per month.
The
call field only contains a date. I've used that field as the column
header
and chose to group it by month, but can't get it to seperate the months by
year. For instance all of March is grouped together whether it's March,
2009
or March, 2010. I'm pretty new to Access so I'm not familiar with SQL or
VBA. Any assistance would be greatly appreciated. Thanks,

Nate
Access 2003


  #9  
Old March 19th, 2010, 07:10 PM posted to microsoft.public.access
inesv
external usenet poster
 
Posts: 5
Default Crosstab Query - Group by Month and Year

Pouvez vous parlez en français !!!


Le 13/03/10 17:02, dans , «*Bob
Quintal*» a écrit*:

"Duane Hookom" wrote in
:

It might be marginally faster but I doubt you could tell unless
your data set is huge. My suggestion will format Jan as 01 with
the leading 0. This will sort the columns from left to right as
you would expect to see them 2009-01, 2009-02,...2009-12 rather
than 2009-1, 2009-10, 2009-11,... 2009-9.


right.



  #10  
Old March 19th, 2010, 09:17 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Crosstab Query - Group by Month and Year

On Fri, 19 Mar 2010 20:10:28 +0100, inesv wrote:

Pouvez vous parlez en français !!!


Non.

http://msdn.microsoft.com/fr-fr/office/default.aspx

--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:12 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.