Solved

Reverse a CrossTab Query

Posted on 2006-10-30
2
961 Views
Last Modified: 2008-04-21
Her is my data:

REASON            10/29/06      10/28/06      10/27/06
15            0      1      10
CANCEL_1            5      5      14
CANCEL_2            36      22      79
CANCEL_3            40      36      74


I want to change it and move it around so it looks like this:

REASON      DAY      VALUES
15      10/29/06      0
CANCEL_1      10/29/06      5
CANCEL_2      10/29/06      36
CANCEL_3      10/29/06      40
15      10/28/06      1
CANCEL_1      10/28/06      5
CANCEL_2      10/28/06      22
CANCEL_3      10/28/06      36
15      10/27/06      10
CANCEL_1      10/27/06      14
CANCEL_2      10/27/06      79
CANCEL_3      10/27/06      74

This is like reversing a crosstab in ACCESS.  

How do I do this? Union Query ? Cross Tab?  Can I use a Query Wizard in ACCESS?
0
Comment
Question by:glenart10
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 150 total points
ID: 17838021
Hi,

I'd do

Select
   Reason, "10/29/06" as Day, [10/29/06] as Values
From tableName
union
Select
   Reason, "10/28/06" as Day, [10/28/06] as Values
From tableName
union
Select
   Reason, "10/27/06" as Day, [10/27/06] as Values
From tableName

unfortunatley there is no tool to do this for you - so you would have to rely on union queries.
0
 

Author Comment

by:glenart10
ID: 17838940
I never had used SQL Viewer while in ACCESS.  

I had to use it here.  This code worked well except I cannot use the FIELD name, VALUES.  That name is a reserved field name and I had to change it.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

738 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