473,385 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Pivot Table to Report

Is there any way to create a pivot table in a report? I have a query
with the fields Date, Name, and Data, and I am trying to create a
report that has the dates running across the top (like fields) grouped
by month, with the names running down the left, and the data values
under each appropriate month.

I am totally stumped on how to do this, other than using a Pivot Table,
but that will not suffice as this has to be created as a report.

Jun 22 '06 #1
5 27693
I guess what I am saying is that a Pivot Table has the ability to group
data and make it into a field, can a report do the same?

JayDawg wrote:
Is there any way to create a pivot table in a report? I have a query
with the fields Date, Name, and Data, and I am trying to create a
report that has the dates running across the top (like fields) grouped
by month, with the names running down the left, and the data values
under each appropriate month.

I am totally stumped on how to do this, other than using a Pivot Table,
but that will not suffice as this has to be created as a report.


Jun 22 '06 #2
"JayDawg" <he******@cox.net> wrote in
news:11**********************@c74g2000cwc.googlegr oups.com:
I guess what I am saying is that a Pivot Table has the ability
to group data and make it into a field, can a report do the
same?

JayDawg wrote:
Is there any way to create a pivot table in a report? I have
a query with the fields Date, Name, and Data, and I am trying
to create a report that has the dates running across the top
(like fields) grouped by month, with the names running down
the left, and the data values under each appropriate month.

I am totally stumped on how to do this, other than using a
Pivot Table, but that will not suffice as this has to be
created as a report.

Pivot table? you mean a Crosstab query in Access.
Here's my method.

Create a query that has the following columns
Names, values, and a number that represents the number of months
ago, so that this month is 0, may is 1, april is 2 etc.

convert to a summary query, group on names, monthsAgo and
sum/count/avg your values (pick 1) set a condition
Change the query type to CrossTab Query in design view.
This will add one row to the grid.
Select "Row Heading" as the value under names, "Column Heading"
under MonthsAgo and Value under Data.

Build your report on this query. You'll have the data you want
under the 0, 1, 2.... headers.

Now write a little code that changes the label captions back to
June, May, April,,, etc. .

This works great if you are willing to live with a constant
number of months, for example the last 12 months of data, every
month.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jun 23 '06 #3
Bob thanks for the help I didnt have to do much other than create the
Cross Tab Query, which put all the fields right where I wanted them. I
had never done a cross tab before, but boy is that useful, thanks
again...

Bob Quintal wrote:
"JayDawg" <he******@cox.net> wrote in
news:11**********************@c74g2000cwc.googlegr oups.com:
I guess what I am saying is that a Pivot Table has the ability
to group data and make it into a field, can a report do the
same?

JayDawg wrote:
Is there any way to create a pivot table in a report? I have
a query with the fields Date, Name, and Data, and I am trying
to create a report that has the dates running across the top
(like fields) grouped by month, with the names running down
the left, and the data values under each appropriate month.

I am totally stumped on how to do this, other than using a
Pivot Table, but that will not suffice as this has to be
created as a report.

Pivot table? you mean a Crosstab query in Access.
Here's my method.

Create a query that has the following columns
Names, values, and a number that represents the number of months
ago, so that this month is 0, may is 1, april is 2 etc.

convert to a summary query, group on names, monthsAgo and
sum/count/avg your values (pick 1) set a condition
Change the query type to CrossTab Query in design view.
This will add one row to the grid.
Select "Row Heading" as the value under names, "Column Heading"
under MonthsAgo and Value under Data.

Build your report on this query. You'll have the data you want
under the 0, 1, 2.... headers.

Now write a little code that changes the label captions back to
June, May, April,,, etc. .

This works great if you are willing to live with a constant
number of months, for example the last 12 months of data, every
month.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com


Jun 23 '06 #4
FYI: If you want to make it easier to work with your crosstabs in report,
and you have this option, it's a good idea to add the list of possible
values after the PIVOT statement

TRANSFORM ...
SELECT ...
FROM ...
GROUP BY ...
PIVOT MyValueField In (0, 1, 2, 3, 4)

This would work where the only possible values for the pivot field are 0
through 4.

If you know them ahead, put them in, so that the report designer does not
have to run the crosstab query in order to know the fields. Those pivot
values become the field names, right?

It also seems to help performance a bit, but I'm not certain because I've
never had a big enough problem to bother doing close comparisons. If
someone knows for sure, I'd love to hear.
Jun 26 '06 #5
So sorry. that should read
TRANSFORM ...
SELECT ...
FROM ...
GROUP BY ...
PIVOT MyColumnHeadingField In (0, 1, 2, 3, 4)

THOSE values become the column headings. the values of course are the
values shown under each of those columns.
Jun 26 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: T Martin | last post by:
I have a pivot table that I created using the pivot table wizard on a form. When I open to edit it brings me to Excel where I can edit and print. Sometimes I get an error message that says...
4
by: Alan Lane | last post by:
Hello world: I'm including both code and examples of query output. I appologize if that makes this message longer than it should be. Anyway, I need to change the query below into a pivot table...
8
by: Jerome Ranch | last post by:
Okay So I've got pivot tables setup in Access 2003. Only about 30K records in the current 2005 databases...the pivots summarize the info in a number of nice ways. I need to get the pivot tables...
9
by: PeteCresswell | last post by:
I've got something called "Reference Rates". The idea is that on a given day, we have various rates of return for various entities. e.g. Libor 3-month return, Libor 6-month return, US Treasury...
3
by: Metplant | last post by:
I have almost no experience in ACCESS so am trying to get the system functioning with minimal operator input. Currently I have managed to modify a database generated by a SCADA system using a...
12
by: kabradley | last post by:
Hello, Thanks for looking at my post and hopefully having an answer or at least a suggestion to my problem. I currently work at a financial planning office that deals with many clients and accounts....
0
by: cbj0517 | last post by:
Hello: I am trying to create a Pivot table in an Access 2003 report. I have SQL that retunrs 6 columns of data, (month_year, units, products_per_unit, gross_sales, price_pe_product, and...
6
by: nicolenwn | last post by:
Hi everyone(: I'm having trouble creating pivot tables using macros. First i tried recording it then running the exact same thing. It worked fine the first time but a week later when i tried...
0
by: sarah2855 | last post by:
Hello, I would like to insert a pivot table in an access report.I was able to create a pivot table chart in Query -> pivot table view but I don't know how to incorporate that in reports. Is this...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.