A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Convert table to another table



 
 
Thread Tools Display Modes
  #1  
Old May 24th, 2004, 07:31 PM
psinta
external usenet poster
 
Posts: n/a
Default Convert table to another table

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.
  #2  
Old May 24th, 2004, 09:36 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default Convert table to another table

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
http://I.Am/DougSteele
(no e-mails, please!)


"psinta" wrote in message
...
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.



  #3  
Old May 25th, 2004, 12:52 AM
psinta
external usenet poster
 
Posts: n/a
Default Convert table to another table

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
http://I.Am/DougSteele
(no e-mails, please!)


"psinta" wrote in message
...
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.



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.