iif statement or better ways

dbertanjoli

Registered User.
Local time
Today, 12:57
Joined
Sep 22, 2000
Messages
102
Hello,
I was hoping someone can help me how to put the following statement in right format. I have 4 fields idResult, QuestionNumber, Description and Result.

So If Question Number and Description have same idResult then Result is (results are defined in the table) there are 30 combinations.

Many thanks,
Debbie
 
Given the information, or lack thereof, you provide i can only guess that you want as many records for each QuestionNumber, Description combination as there are Results?
This is a carthesian product which you can accomplish by not joining two tables/queries.
Code:
select a.questionnumber, a.description, a.resultid, b.result from a, b
HTH:D
 
Many thanks for your reply.

I followed your instructions and replicated your code into:
select Questions.QuestionNumber, Questions.QuestionAnswer, tblResult.IDResultO, tblResult.Results from Questions, tblResult
but I got over 4000 records instead of 31.

I have a webform that feeds in this database. Webform has 31 questions (multiple choice) but even though the answers for each question are mostly the same (for example good, very good) they have different scoring attached to them depending on question.

So I created a separated table that holds scores (for example question one, can have 5possible answers and and they are scored from 1 to 5 and so on, so I have 5 scoring options for each question. I am attaching my table structure. The code you sent me is perfect but we just need to figure out to have right number of records in this query.

Very grateful,
Deb
 

Attachments

Your tables don't make any sense. The questions table do not contain any questions but also answers and UserID's. That's very strange for a questions table. Loose the UserID field.
 

Users who are viewing this thread

Back
Top Bottom