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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Crosstab more than a years data??



 
 
Thread Tools Display Modes
  #1  
Old February 13th, 2007, 09:00 PM posted to microsoft.public.access.queries
Bill
external usenet poster
 
Posts: 216
Default Crosstab more than a years data??

Hi All,

I would like to use a crosstab query to analyse monthly data over a longer
period than a year but it doesn't seem to be able to do that, instead the
second years (and the rest) data just accumulate under each month total.

Any pointers please?

Ta.
Bill.


  #2  
Old February 13th, 2007, 09:23 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Crosstab more than a years data??

Post the SQL view of your query.

I suspect that you are pivoting on just the month and not the month and
year.

Try replacing Month(DateField) with
Format([DateField], "yyyy-mm")



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Bill" wrote in message
...
Hi All,

I would like to use a crosstab query to analyse monthly data over a longer
period than a year but it doesn't seem to be able to do that, instead the
second years (and the rest) data just accumulate under each month total.

Any pointers please?

Ta.
Bill.



  #3  
Old February 13th, 2007, 09:33 PM posted to microsoft.public.access.queries
George Nicholson
external usenet poster
 
Posts: 791
Default Crosstab more than a years data??

Try replacing Month(DateField) with
Format([DateField], "yyyy-mm")


Which will give you 24 columns if your data covers 2 years. Great, if that's
what you want.

You could also add Year([DateField]) to the Cross tab as a RowHeader field,
giving you separate 2006 & 2007 lines for each of the 12 monthly columns.

HTH,


"John Spencer" wrote in message
...
Post the SQL view of your query.

I suspect that you are pivoting on just the month and not the month and
year.

Try replacing Month(DateField) with
Format([DateField], "yyyy-mm")



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

"Bill" wrote in message
...
Hi All,

I would like to use a crosstab query to analyse monthly data over a
longer period than a year but it doesn't seem to be able to do that,
instead the second years (and the rest) data just accumulate under each
month total.

Any pointers please?

Ta.
Bill.





  #4  
Old February 13th, 2007, 10:04 PM posted to microsoft.public.access.queries
Bill
external usenet poster
 
Posts: 216
Default Crosstab more than a years data??

Crosstab query wizard stuff I'm afraid, are there any online resources to
help get more from crosstabs? I did try the replacement you suggested, maybe
I did it wrong, but it didn't work!!

Current SQL:-

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Count([q_Assignments to Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee
PIVOT Format([#DateAssign],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

Regards.
Bill.


"John Spencer" wrote in message
...
Post the SQL view of your query.

I suspect that you are pivoting on just the month and not the month and
year.

Try replacing Month(DateField) with
Format([DateField], "yyyy-mm")



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

"Bill" wrote in message
...
Hi All,

I would like to use a crosstab query to analyse monthly data over a
longer period than a year but it doesn't seem to be able to do that,
instead the second years (and the rest) data just accumulate under each
month total.

Any pointers please?

Ta.
Bill.





  #5  
Old February 13th, 2007, 10:28 PM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Crosstab more than a years data??

This all depends on how you want to separate years. This is one solution:

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Year([#DateAssign]) as Yr,
Count([q_Assignments to Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee, Year([#DateAssign])
PIVOT Format([#DateAssign],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

Crosstab query wizard stuff I'm afraid, are there any online resources to
help get more from crosstabs? I did try the replacement you suggested, maybe
I did it wrong, but it didn't work!!

Current SQL:-

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Count([q_Assignments to Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee
PIVOT Format([#DateAssign],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

Regards.
Bill.


"John Spencer" wrote in message
...
Post the SQL view of your query.

I suspect that you are pivoting on just the month and not the month and
year.

Try replacing Month(DateField) with
Format([DateField], "yyyy-mm")



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

"Bill" wrote in message
...
Hi All,

I would like to use a crosstab query to analyse monthly data over a
longer period than a year but it doesn't seem to be able to do that,
instead the second years (and the rest) data just accumulate under each
month total.

Any pointers please?

Ta.
Bill.






  #6  
Old February 13th, 2007, 10:53 PM posted to microsoft.public.access.queries
Bill
external usenet poster
 
Posts: 216
Default Crosstab more than a years data??

Well that is helpful but the next step is doing a graph to look at trend. So
really it would be better, though I accept not pretty, if the results were
in one row. Unless there is a way of creating a graph from the data in the
format that this produces??

If possible I want to have to do as little each time as possible because
this is going to be a regular monthly report.

Thanks.
Bill


"Duane Hookom" wrote in message
...
This all depends on how you want to separate years. This is one solution:

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Year([#DateAssign]) as Yr,
Count([q_Assignments to Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee, Year([#DateAssign])
PIVOT Format([#DateAssign],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

Crosstab query wizard stuff I'm afraid, are there any online resources to
help get more from crosstabs? I did try the replacement you suggested,
maybe
I did it wrong, but it didn't work!!

Current SQL:-

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Count([q_Assignments to
Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee
PIVOT Format([#DateAssign],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

Regards.
Bill.


"John Spencer" wrote in message
...
Post the SQL view of your query.

I suspect that you are pivoting on just the month and not the month and
year.

Try replacing Month(DateField) with
Format([DateField], "yyyy-mm")



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

"Bill" wrote in message
...
Hi All,

I would like to use a crosstab query to analyse monthly data over a
longer period than a year but it doesn't seem to be able to do that,
instead the second years (and the rest) data just accumulate under
each
month total.

Any pointers please?

Ta.
Bill.








  #7  
Old February 14th, 2007, 05:34 AM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Crosstab more than a years data??

Do you have an idea what you want your graphs to look like? Do you want each
assignee to have their own graph or what?
--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

Well that is helpful but the next step is doing a graph to look at trend. So
really it would be better, though I accept not pretty, if the results were
in one row. Unless there is a way of creating a graph from the data in the
format that this produces??

If possible I want to have to do as little each time as possible because
this is going to be a regular monthly report.

Thanks.
Bill


"Duane Hookom" wrote in message
...
This all depends on how you want to separate years. This is one solution:

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Year([#DateAssign]) as Yr,
Count([q_Assignments to Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee, Year([#DateAssign])
PIVOT Format([#DateAssign],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

Crosstab query wizard stuff I'm afraid, are there any online resources to
help get more from crosstabs? I did try the replacement you suggested,
maybe
I did it wrong, but it didn't work!!

Current SQL:-

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Count([q_Assignments to
Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee
PIVOT Format([#DateAssign],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

Regards.
Bill.


"John Spencer" wrote in message
...
Post the SQL view of your query.

I suspect that you are pivoting on just the month and not the month and
year.

Try replacing Month(DateField) with
Format([DateField], "yyyy-mm")



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

"Bill" wrote in message
...
Hi All,

I would like to use a crosstab query to analyse monthly data over a
longer period than a year but it doesn't seem to be able to do that,
instead the second years (and the rest) data just accumulate under
each
month total.

Any pointers please?

Ta.
Bill.









  #8  
Old February 14th, 2007, 10:27 AM posted to microsoft.public.access.queries
Bill
external usenet poster
 
Posts: 216
Default Crosstab more than a years data??

y axis would be number of calls
x axis would be time, probably months.

Preferably the graph would have one line for each assignee, hence the need
for one timeline, not one for each year.

Cheers.
Bill.



"Duane Hookom" wrote in message
...
Do you have an idea what you want your graphs to look like? Do you want
each
assignee to have their own graph or what?
--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

Well that is helpful but the next step is doing a graph to look at trend.
So
really it would be better, though I accept not pretty, if the results
were
in one row. Unless there is a way of creating a graph from the data in
the
format that this produces??

If possible I want to have to do as little each time as possible because
this is going to be a regular monthly report.

Thanks.
Bill


"Duane Hookom" wrote in message
...
This all depends on how you want to separate years. This is one
solution:

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Year([#DateAssign]) as Yr,
Count([q_Assignments to Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee, Year([#DateAssign])
PIVOT Format([#DateAssign],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

Crosstab query wizard stuff I'm afraid, are there any online resources
to
help get more from crosstabs? I did try the replacement you suggested,
maybe
I did it wrong, but it didn't work!!

Current SQL:-

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Count([q_Assignments to
Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee
PIVOT Format([#DateAssign],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

Regards.
Bill.


"John Spencer" wrote in message
...
Post the SQL view of your query.

I suspect that you are pivoting on just the month and not the month
and
year.

Try replacing Month(DateField) with
Format([DateField], "yyyy-mm")



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

"Bill" wrote in message
...
Hi All,

I would like to use a crosstab query to analyse monthly data over a
longer period than a year but it doesn't seem to be able to do
that,
instead the second years (and the rest) data just accumulate under
each
month total.

Any pointers please?

Ta.
Bill.











  #9  
Old February 14th, 2007, 02:57 PM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Crosstab more than a years data??

If you want a different line for each employee then you should use assignee
as the column heading. Your Row Heading would be something like:
RowHead: Format([#DateAssign],"yyyy-mm")
You could set the value of the crosstab to count CallID.

--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

y axis would be number of calls
x axis would be time, probably months.

Preferably the graph would have one line for each assignee, hence the need
for one timeline, not one for each year.

Cheers.
Bill.



"Duane Hookom" wrote in message
...
Do you have an idea what you want your graphs to look like? Do you want
each
assignee to have their own graph or what?
--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

Well that is helpful but the next step is doing a graph to look at trend.
So
really it would be better, though I accept not pretty, if the results
were
in one row. Unless there is a way of creating a graph from the data in
the
format that this produces??

If possible I want to have to do as little each time as possible because
this is going to be a regular monthly report.

Thanks.
Bill


"Duane Hookom" wrote in message
...
This all depends on how you want to separate years. This is one
solution:

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Year([#DateAssign]) as Yr,
Count([q_Assignments to Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee, Year([#DateAssign])
PIVOT Format([#DateAssign],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

Crosstab query wizard stuff I'm afraid, are there any online resources
to
help get more from crosstabs? I did try the replacement you suggested,
maybe
I did it wrong, but it didn't work!!

Current SQL:-

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Count([q_Assignments to
Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee
PIVOT Format([#DateAssign],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

Regards.
Bill.


"John Spencer" wrote in message
...
Post the SQL view of your query.

I suspect that you are pivoting on just the month and not the month
and
year.

Try replacing Month(DateField) with
Format([DateField], "yyyy-mm")



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

"Bill" wrote in message
...
Hi All,

I would like to use a crosstab query to analyse monthly data over a
longer period than a year but it doesn't seem to be able to do
that,
instead the second years (and the rest) data just accumulate under
each
month total.

Any pointers please?

Ta.
Bill.












  #10  
Old February 14th, 2007, 09:24 PM posted to microsoft.public.access.queries
Bill
external usenet poster
 
Posts: 216
Default Crosstab more than a years data??

RowHead: Format([#DateAssign],"yyyy-mm")

The "yyy-mm" bit doesn't work. The crosstab still builds but the
intersection values are empty!!
Any ideas?


"Duane Hookom" wrote in message
...
If you want a different line for each employee then you should use

assignee
as the column heading. Your Row Heading would be something like:
RowHead: Format([#DateAssign],"yyyy-mm")
You could set the value of the crosstab to count CallID.

--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

y axis would be number of calls
x axis would be time, probably months.

Preferably the graph would have one line for each assignee, hence the

need
for one timeline, not one for each year.

Cheers.
Bill.



"Duane Hookom" wrote in message
...
Do you have an idea what you want your graphs to look like? Do you

want
each
assignee to have their own graph or what?
--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

Well that is helpful but the next step is doing a graph to look at

trend.
So
really it would be better, though I accept not pretty, if the results
were
in one row. Unless there is a way of creating a graph from the data

in
the
format that this produces??

If possible I want to have to do as little each time as possible

because
this is going to be a regular monthly report.

Thanks.
Bill


"Duane Hookom" wrote in message
...
This all depends on how you want to separate years. This is one
solution:

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Year([#DateAssign]) as Yr,
Count([q_Assignments to Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee, Year([#DateAssign])
PIVOT Format([#DateAssign],"mmm") In

("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

--
Duane Hookom
Microsoft Access MVP


"Bill" wrote:

Crosstab query wizard stuff I'm afraid, are there any online

resources
to
help get more from crosstabs? I did try the replacement you

suggested,
maybe
I did it wrong, but it didn't work!!

Current SQL:-

TRANSFORM Count([q_Assignments to Tim].CallID) AS CountOfCallID
SELECT [q_Assignments to Tim].Assignee, Count([q_Assignments to
Tim].CallID)
AS [Total Of CallID]
FROM [q_Assignments to Tim]
GROUP BY [q_Assignments to Tim].Assignee
PIVOT Format([#DateAssign],"mmm") In

("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"," Sep","Oct","Nov","Dec");

Regards.
Bill.


"John Spencer" wrote in message
...
Post the SQL view of your query.

I suspect that you are pivoting on just the month and not the

month
and
year.

Try replacing Month(DateField) with
Format([DateField], "yyyy-mm")



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

"Bill" wrote in message
...
Hi All,

I would like to use a crosstab query to analyse monthly data

over a
longer period than a year but it doesn't seem to be able to do
that,
instead the second years (and the rest) data just accumulate

under
each
month total.

Any pointers please?

Ta.
Bill.














 




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 08:42 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.