Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Need some lelp with SQL

Author  Topic 

helixpoint
Constraint Violating Yak Guru

291 Posts

Posted - 2005-01-11 : 18:37:46
I have 3 tables.

Table1: FormCreator_Questions

QuestionID int 4 0
ModuleID int 4 0
Question varchar 1000 0

Table 2: FormCreator_QuestionOptions

OptionID int 4 0
QuestionID int 4 0
OptionText nvarchar 500 0

Table3: FormCreator_Results

ResultID int 4 0
QuestionID int 4 0
OptionID int 4 0
OptionTextboxValue varchar 6000 1
Username varchar 100 1
Comments varchar 1000 1
ResultDate datetime 8 0
OrderID int 4 1
SurveyName varchar 50 1
SurveyResultID int 4 1
ModuleID int 4 1

Basically This is a form builder. Table 1 is the questions Table 2 is the
question options and table 3 is the results. Not sure if this is possible
but I would like put the reults in a report like so:

Table1.Question (1) Table1.Question (2) Table1.Question (3)
Table3.OptionTextboxValue Table3.OptionTextboxValue Table3.OptionTextboxValue


First Name Last Name E-mail Can you receive and view HTML e-mails
Jim Smith jsmith@aaaa.com Yes
Joe Mallory jmallory@ssss.net No




Table1 examples:

18 362 First Name
19 362 Last Name
20 362 E-mail
21 362 Can you receive and view HTML e-mails
--

Table2

2 18 firstName
4 19 lastName
6 20 emailAdd
15 21 Yes
16 21 No


Table 3
71 18 -55 Jim 1 362
72 19 -55 Smith 1 362
73 20 -55 jsmith@aaaa.com 1 362
74 21 15 1 362
85 18 -55 Joe 2 362
86 19 -55 Mallory 2 362
87 20 -55 jmallory@ssss.net 2 362
88 21 16 2 362


Dave
   

- Advertisement -