Re: Extract data to new fields

From: gordzilla2000 (gordzilla2000_at_hotmail.com)
Date: 03/17/04


Date: Tue, 16 Mar 2004 16:28:43 -0800

That would work except I need to get the Field name "Q2"
into the new table as well as the
The new table will have the fields
SurveyID, Question_no, Reponse
1 Q1 Yes
1 Q2 No

Currently the field Q1 holds the response and the Field
name represents the question number.
There are over 800 fields (questions) in 5 tables

>-----Original Message-----
>try a union query:
>
>make this query and save it.
>select SurveryId, Q1 as Question, Response from
tblSurvey
>union
>select SurveryId, Q2 as Question, Response from
tblSurvey
>union
>select SurveryId, Q3 as Question, Response from
tblSurvey
>union
>select SurveryId, Q4 as Question, Response from
tblSurvey
>union
>select SurveryId, Q5 as Question, Response from
tblSurvey
>
>then make an append query and append all records from
the union query into
>your new table.
>
>Rodrigo.
>
>
>
>Rodrigo.
>"gordzilla2000" <gordzilla2000@hotmail.com> wrote in
message
>news:e4ea01c40b9a$2f4fbb00$a501280a@phx.gbl...
>> I have a table that was created to accept the responses
>> from a survey.
>>
>> The table was created with a field for each response to
>> each question:
>> SurveyID autonumber
>> q1 text 50
>> q2 text 50
>> q3 text 50
>> q4 text 50
>> etc.
>>
>> I would like to change this to one record per question
>> i.e.
>>
>> SurveyID autonumber
>> Question_no text 2
>> Response text 50
>>
>> A sample of records would then be:
>> 1 Q1 Yes
>> 1 Q2 No
>> 2 Q1 No
>> 2 Q2 Yes
>>
>> Is there an easy way to do this?
>>
>
>
>.
>



Relevant Pages

  • Re: Extract data to new fields
    ... try a union query: ... select SurveryId, Q1 as Question, Response from tblSurvey ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Extract data to new fields
    ... select SurveryId, "Q1" as Question, Q1 AS Response from tblSurvey ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Extract data to new fields
    ... Currently it gives me strSQL ="INSERT INTO tmpNewSurvey (SurveyId, ... "P1S1Q01" AS Response FROM tblSurvey; ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Extract data to new fields
    ... INSERT INTO tmpNewSurvey (SurveryId, Question, Response) SELECT ... And the double quotes (or single quote) right after the commas on question. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Crosstab queries
    ... In the Union query, I end up with the "Response" colum that contains all ... Tom ... >>> Duane Hookom ...
    (microsoft.public.access.queries)