![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
You are correct in that the information is coming from different tables. The people "upstairs" have been using a web-based survey system that dumps the results into SQL. The problem, is that I am trying to run reports on some of the information and the way the data is laid out is making it difficult. For example, the survey in question is a short 4 question survey with 2 radio selection groups and then there are 2 text field entries. I am only concerned with the 2 radio selection questions. Question 1 has 4 radio options and question 2 has 5. The problem here is that when the system submits the data to the DB, it creates a record for EACH answer on the survey. For example, the VoterAnswers table will have the VoterID, AnswerText, etc... for each question on the survey with the VoterID remaining the same. This is what is looks like: VoterID AnswerText AnswerID 5 Comments here 2058 5 <NULL> 2057 5 <NULL> 2059 AnswerID is found in the Answer table which corresponds (in this case) to 2057="Technology" and 2059="Satisfied" What I need is one recordset with the following format. VoterID Department Rating ---------- ----------------- ------------ 5 Technology Satisfied Does this clear anything up? |
#12
| |||
| |||
|
#13
| |||
| |||
|
|
But how to which know which row is the department and which is the rating? -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books... Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx- Hide quoted text - - Show quoted text - |
#14
| |||
| |||
|
|
The AnswerID corresponds to the Department. One row for each. To make is simple, it essentially has only the AnswerID and the AnswerText. |
![]() |
| Thread Tools | |
| Display Modes | |
| |