Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to "Transpose"

Status
Not open for further replies.

bkf7911

MIS
Mar 20, 2007
83
US
I have data in the following format:

Month Q1 Q2 Q3 Q4 Q5 Q6
Jan 20 21 22 23 24 25

and need it in the following format (table or query, not form/report):

Month Question Volume
Jan Q1 20
Jan Q2 21
Jan Q3 22
Jan Q4 23
Jan Q5 24
Jan Q6 25

Is there a way to "transpose", much like in excel? I've used a series of update queries in the past, but this was cumbersome.
 




Transpose in excel and IMPORT.

Skip,

[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue]
 
How about:

Code:
SELECT Month, "Q1" As QNo, Q1 As Ans FROM ...
UNION
SELECT Month, "Q2" As QNo, Q2 As Ans FROM ...
<...>
UNION
SELECT Month, "Qn" As QNo, Qn As Ans FROM ...
 
Skip, I don't think that will work for my customer. Thanks for the offer though.

Remou, this so works. Thank you for saving me much time in writing and rewriting queries.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top