Solved

Reverse a CrossTab Query

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

910 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

24 Experts available now in Live!

Get 1:1 Help Now