all groups > sql server programming > february 2005 >
You're in the

sql server programming

group:

trying to get a report aout of ths data


trying to get a report aout of ths data DaveF
2/8/2005 10:15:46 PM
sql server programming:
Out of the 3 tables below. I need to get a tabular report like this

First Name Last Name Email =
Can you receive HTML email Address =
State Zip
Tom Thompson xxxx@xxxxxxxx.com =
Yes 575 =
mystreet Rd AK 14525
steve Smith =
aaaa@aaaaaaaa.com No =
575 double Dam Rd AL 13323




table 1

QuestionID ModID Question
18 362 First Name=20
19 362 Last Name=20
20 362 Email=20
21 362 Can you receive HTML email
23 362 Address=20
24 362 State=20
25 362 Zip=20


Table 2

Resultid QuestionID OptionD =
OptionTextboxValue SurveyResultID modid
2051 18 -55 Tom =
140 362
2052 19 -55 =
Thompson 140 362
2053 20 -55 =
xxxx@xxxxxxxx.com 140 362
2055 21 47 =
140 =
362
2056 23 -55 575 =
mystreet Rd 140 362
2057 24 52 =
140 =
362
2058 25 -55 =
14525 140 =
362
2059 18 -55 =
steve 140 =
362
2060 19 -55 =
Smith 140 =
362
2061 20 -55 =
aaaa@aaaaaaaa.com 140 362
2063 21 48 =
140 =
362
2064 23 -55 575 =
double Dam Rd 140 362
2065 24 53 =
140 =
362
2066 25 -55 =
13323 140 =
362

Table3

optionid QuestionID optionText
41 18 firstName
43 19 lastName
45 20 emailAdd
47 21 Yes
48 21 No
50 23 address
52 24 AK
53 24 AL
Re: trying to get a report aout of ths data David Portas
2/8/2005 11:32:31 PM
What is the rationale for your table design and for persisting the UI
information in the database? Don't you have normalized tables to
represent this information? If this is some kind of content management
layer then I would suggest you don't use it for reporting. Utilize it
as a Staging database with an ETL process to load into a normalized
data model. There are plenty of reasons why the
"entity-attribute-value" model you are proposing should be avoided in
SQL.

Anyway, take a look here for some solutions to your cross-tab report:
http://www.aspfaq.com/2462

--
David Portas
SQL Server MVP
--
Re: trying to get a report aout of ths data DaveF
2/9/2005 7:41:43 AM
This is what I have to work with. Can't change it

--


David


[quoted text, click to view]

AddThis Social Bookmark Button