Tables for a Questionnaire with different response data types?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table for the questions (54 of them) with one record per question
and the QuestID as the primary key. I have a table for the responses with a
record for each facility responding. That table does not include the
QuestID. My problem is creating a query that pulls in the QuestId and
matches it with the appropriate response for each facility. I reviewed the
Knowledge Base but only found suggestions when the response types are all a
'yes/no' data type. I have various data types. Any advice? Thanks in
advance, Anne
 
If your response table doesn't have the QuestID in it, how do you know the
question to which they were responding?
 
I'm sorry, I 'misspoke'. It does have the QuestID, but not the text of the
question. It has a field with "Q1" and a data type appropriate for the
question whose QuestID is "Q1". I want to pull the Question itself (which is
in a field called "Question" in the record of each QuestID.
 
Are you saying that your response table has 54 fields named Q1, Q2, Q3 etc.?
If so, your table has not been normalized: that's called a repeating group,
and is almost always a bad idea.

Instead, you should have 54 rows corresponding to each set of answers. Yes,
if different questions can have different answer types, this can be a little
messy. One approach is to have a field for possible boolean answers, one for
possible numeric answers and one for possible text answers, and have an
indicator in the Question table as to which one you should be using.
 
annem said:
I'm sorry, I 'misspoke'. It does have the QuestID, but not the text of
the
question. It has a field with "Q1" and a data type appropriate for the
question whose QuestID is "Q1". I want to pull the Question itself (which
is
in a field called "Question" in the record of each QuestID.
 
Douglas J. Steele said:
Are you saying that your response table has 54 fields named Q1, Q2, Q3
etc.? If so, your table has not been normalized: that's called a repeating
group, and is almost always a bad idea.

Instead, you should have 54 rows corresponding to each set of answers.
Yes, if different questions can have different answer types, this can be a
little messy. One approach is to have a field for possible boolean
answers, one for possible numeric answers and one for possible text
answers, and have an indicator in the Question table as to which one you
should be using.
 
Douglas J. Steele said:
Are you saying that your response table has 54 fields named Q1, Q2, Q3
etc.? If so, your table has not been normalized: that's called a repeating
group, and is almost always a bad idea.

Instead, you should have 54 rows corresponding to each set of answers.
Yes, if different questions can have different answer types, this can be a
little messy. One approach is to have a field for possible boolean
answers, one for possible numeric answers and one for possible text
answers, and have an indicator in the Question table as to which one you
should be using.
 
annem said:
I'm sorry, I 'misspoke'. It does have the QuestID, but not the text of
the
question. It has a field with "Q1" and a data type appropriate for the
question whose QuestID is "Q1". I want to pull the Question itself (which
is
in a field called "Question" in the record of each QuestID.
 
Douglas J. Steele said:
Are you saying that your response table has 54 fields named Q1, Q2, Q3
etc.? If so, your table has not been normalized: that's called a repeating
group, and is almost always a bad idea.

Instead, you should have 54 rows corresponding to each set of answers.
Yes, if different questions can have different answer types, this can be a
little messy. One approach is to have a field for possible boolean
answers, one for possible numeric answers and one for possible text
answers, and have an indicator in the Question table as to which one you
should be using.
 

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

Back
Top