Hi John,
When I import the data from excel into Access I keep the generic titles that
are pulled from the survey because it is systematic. The fields are named
based on their location on the table question of the survey.
Example: 1 (Q1_A_1) = Section 1, Question 1, column A, Row 1
This data is pulled from a table question. Hence All data in row 1 of the
table question is associated with candidate 1... row 2 is candidate 2.. and
so forth. Unfortunately I don't have the ease of pulling the suvey data with
the same table question formatting as it is on the survey tool into Excel.
Below is the data as it is pulled directly into a spreadsheet which I then
import into an access database.
Column 1: 1 (Q1_A_1) - John Doe
Column 2: 1 (Q1_A_2) - Jane Smith
Column 3: 1 (Q1_A_3) - Ben Barker
Column 4: 1 (Q1_A_4) - Don Juan
Column 5: 1 (Q1_B_1) - Low
Column 6: 1 (Q1_B_2) - Med
Column 7: 1 (Q1_B_3) - Low
Column 8: 1 (Q1_B_4) - High
Column 9: 1 (Q1_C_1) - Now
Column 10: 1 (Q1_C_2) - 1 Yr.
Column 11: 1 (Q1_C_3) - 1 Yr.
Column 12: 1 (Q1_C_4) - 3 Yrs.
With the explanation above about how information for each candidate is
ascertained, I would like for the data to look like this in the query (This
is how the data looks in the table question):
Candidates Risk Readiness
John Doe Low Now
Jane Smith Med 1 Yr.
Ben Barker Low 1 Yr.
Don Juan High 3 Yrs.
I hope this is a little clearer.
Much. That's got to be the wierdest layout for questionnaires that I've ever
seen. I presume that one time there might be four rows, the next time eleven?
If it's JUST as you describe a Normalizing Union query will do the job. I'll
assume that the first row of the spreadsheet has your Q names and that you
have used them as the fieldnames for a (linked or imported, it shouldn't
matter) temporary table, which I'll call tblTemp.
You will need to go into the SQL window of a new Query, and edit or copy and
paste:
SELECT [Q1_A_1] AS Candidate, [Q1_B_1] AS Risk, [Q1_C_1] AS Readiness
FROM tblTemp
WHERE [Q1_A_1] IS NOT NULL
UNION ALL
SELECT [Q1_A_2] AS Candidate, [Q1_B_2] AS Risk, [Q1_C_2] AS Readiness
FROM tblTemp
WHERE [Q1_A_2] IS NOT NULL
UNION ALL
SELECT [Q1_A_3] AS Candidate, [Q1_B_3] AS Risk, [Q1_C_3] AS Readiness
FROM tblTemp
WHERE [Q1_A_3] IS NOT NULL
UNION ALL
SELECT [Q1_A_4] AS Candidate, [Q1_B_4] AS Risk, [Q1_C_4] AS Readiness
FROM tblTemp
WHERE [Q1_A_4] IS NOT NULL
This query will "unravel" the spreadsheet into a tall-thin table. I'm sure you
can extend the logic to more columns as needed.
You can then base a MakeTable or (better) Append query - into a predefined
normalized empty table - on this stored UNION query. Running it will pull the
data out of the spreadsheet into the new table.