Showing posts with label countytable. Show all posts
Showing posts with label countytable. Show all posts

Monday, March 19, 2012

How to use row values from query

Our database is normalized to the point that I need to build a dataset to
render a report from.
For example "select county name from COUNTYTABLE where COUNTYNUMBER IN
(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ". This query return 1 column and 15
rows of county names. I need them to be in 1 row and 15 columns to make up
the data going accross the report. What is the best way to do this?
Thanks,
ShawnI you create a matrix report with County Name across the top of the matrix,
it will automatically generate the appropriate number of columns...
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)
I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
"sysdesigner" <sysdesigner@.discussions.microsoft.com> wrote in message
news:55F38FB8-CBD1-4C1C-9611-8247A1A5C60E@.microsoft.com...
> Our database is normalized to the point that I need to build a dataset to
> render a report from.
> For example "select county name from COUNTYTABLE where COUNTYNUMBER IN
> (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ". This query return 1 column and
15
> rows of county names. I need them to be in 1 row and 15 columns to make
up
> the data going accross the report. What is the best way to do this?
> Thanks,
> Shawn
>|||I need to make a report that looks like...
Statistic A Statistic B Statistic C Statistic D
----
99 07 102 91
It would be easy but the values are all in one column in the table, like...
KeyValue | StatisticCode | StatisticValue
001| A| 99
002| B| 07
003| D| 91
004| C| 102
Thanks,
Shawn
"Wayne Snyder" wrote:
> I you create a matrix report with County Name across the top of the matrix,
> it will automatically generate the appropriate number of columns...
> --
> Wayne Snyder MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> (Please respond only to the newsgroup.)
> I support the Professional Association for SQL Server ( PASS) and it's
> community of SQL Professionals.
> "sysdesigner" <sysdesigner@.discussions.microsoft.com> wrote in message
> news:55F38FB8-CBD1-4C1C-9611-8247A1A5C60E@.microsoft.com...
> > Our database is normalized to the point that I need to build a dataset to
> > render a report from.
> >
> > For example "select county name from COUNTYTABLE where COUNTYNUMBER IN
> > (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ". This query return 1 column and
> 15
> > rows of county names. I need them to be in 1 row and 15 columns to make
> up
> > the data going accross the report. What is the best way to do this?
> >
> > Thanks,
> > Shawn
> >
>
>