Convert table to another table

P

psinta

I need help converting this table:

Number 1 2 3 4 5 6
196 A C A B D E

Number 1..6 are question no.
196 is the number
A...E are the answers.

I them to be like this:

Number Question Answer
196 1 A
196 2 C
196 3 A
196 4 B
196 5 D
196 6 E

Thanks.
 
D

Douglas J. Steele

Create a Union query on your table.

The query should look something like:

SELECT Number, 1 As Question, [1] As Answer
FROM MyTable
UNION
SELECT Number, 2 As Question, [2] As Answer
FROM MyTable
UNION
SELECT Number, 3 As Question, [3] As Answer
FROM MyTable
UNION
SELECT Number, 4 As Question, [4] As Answer
FROM MyTable
UNION
SELECT Number, 5 As Question, [5] As Answer
FROM MyTable
UNION
SELECT Number, 6 As Question, [6] As Answer
FROM MyTable

Save that query, then use it as the source for a MakeTable query.
 
P

psinta

Thank you so much.
-----Original Message-----
Create a Union query on your table.

The query should look something like:

SELECT Number, 1 As Question, [1] As Answer
FROM MyTable
UNION
SELECT Number, 2 As Question, [2] As Answer
FROM MyTable
UNION
SELECT Number, 3 As Question, [3] As Answer
FROM MyTable
UNION
SELECT Number, 4 As Question, [4] As Answer
FROM MyTable
UNION
SELECT Number, 5 As Question, [5] As Answer
FROM MyTable
UNION
SELECT Number, 6 As Question, [6] As Answer
FROM MyTable

Save that query, then use it as the source for a MakeTable query.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


psinta said:
I need help converting this table:

Number 1 2 3 4 5 6
196 A C A B D E

Number 1..6 are question no.
196 is the number
A...E are the answers.

I them to be like this:

Number Question Answer
196 1 A
196 2 C
196 3 A
196 4 B
196 5 D
196 6 E

Thanks.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top