Solved

Easy Method to convert from row to column format

Posted on 2014-01-26
3
374 Views
Last Modified: 2014-03-03
I have a table with the following structure
  ProductID / ProductionDate / NumberProduced
  888               12/15/2013           25
  889               12/15/2013           17
  890               12/15/2013           19

  888               12/16/2013           12
  889               12/16/2013           30
 
  888               12/17/2013           75
  890               12/17/2013           50

I need to print a report that converts this from a row format to a columnar format
                      First          Second     Third
  Product      Date          Date          Date               Total
                     12/15/13   12/16/13  12/17/13
  888             25              12              75                   sum(888)
  889             17              30                                     sum(889)
  890             19                                50                   sum(890)
                     sum(15)     sum(16)    sum(17)         Total(sum)

The dates will be variable from 1-31 days (ability to run for whole month)
I had thought of  doing the following
  Create a query (will be modified by code for days 1-31). Query will place data in a work table with columns labeled from 1-31 (example column names: Day01Production, Day02Production, etc)
  Then my report or form will access the values in these fields to print or display.
  There are a couple of other fields that will need to be presented also. I just kept it simple
  Can this be done with a pivot table? I have worked with them in Excel. Not much experience with pivot and Access.
0
Comment
Question by:rodneygray
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 39810878
They're known as Crosstabs in Access. Essentially you create a Crosstab query, and then build a report using that Crosstab.

Here's an Office tutorial that might help:

http://office.microsoft.com/en-us/access-help/make-summary-data-easier-to-read-by-using-a-crosstab-query-HA010229577.aspx
0
 
LVL 10

Assisted Solution

by:LukeChung-FMS
LukeChung-FMS earned 250 total points
ID: 39812006
Here's an example of Creating an Annual 12 Month Summary Report without VBA Code by Creatively Using a Microsoft Access Crosstab Query
http://www.fmsinc.com/MicrosoftAccess/query/crosstab-report/index.html

It's designed to handle any 12 month period. Could be adapted to handle days vs. months. A free sample database is included that you can download. Hope this helps.
0
 
LVL 30

Expert Comment

by:hnasr
ID: 39813837
Previous comments looks fine.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now