Solved

Reverse a CrossTab Query

Posted on 2006-10-30
2
965 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

Technology Partners: 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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

728 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