473,789 Members | 2,957 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 27724
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.n et> wrote in
news:11******** **************@ c74g2000cwc.goo glegroups.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.n et> wrote in
news:11******** **************@ c74g2000cwc.goo glegroups.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 MyColumnHeading Field 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
1363
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 "Microsoft Excel has encountered a problem and needs to close." I have the option of Sending Report and Not Sending Report and I can also see the data this error report contains. Any suggestions??? I'm running: Windows XP Pro (SP2) - it's not...
4
2858
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 query. I'm having trouble doing it. Help! Here is my code so far: Sub OldRegionQuery()
8
4872
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 into a document so I can distribute the tables, as is, as an electronic report (without the detailed data) So I export to rtf and xls, and I get an error that there is a too much information. I don't want all the data, just the summary table!
9
6799
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 Bonds, the Prime rate, and so-forth. We associate a security with one of those rates. There are a set of rates for each calendar day, and the rates for that
3
2027
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 query which generates a PIVOT table, grouped by DateAndTime, for all the desired data for Reporting purposes. I have not been able to set the DateAndTime range of that data; so then a set group of data can be sent as a file to an archive location...
12
3113
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. Each client may have multiple accounts such as an individual, IRA, and possibly a joint tenant account. Each one of these accounts for the particular client is contained in a 'Portfolio'. For example, Joe Smith may have 3 accounts: Joe Smith...
0
2228
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 avg_days_to_fulfill). I would like the columns of the pivot to be the months of the year, and a row for each of the other columns, with a total column at the end. It can be done in Excel, but I need it to be in a report. The crosstab query would be great,...
6
3152
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 it again the pivot table failed me. As i am using raw data as the data source, hence the number of rows changes everyday and therefore the datasource for the pivot table code cannot be fixed. How do i do this? ...
0
2143
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 doable at all? Thanks in advance, Sarah
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.