Tuesday, March 20, 2012

Combine rows data into a Column

I have two tables, which you can call master and details. I want to pull data
from master table and respective details from details table. Here are tables
and data information.
Master Table
MID Description
1 Person â' 1
2 Person -2
3 Person â' 3
Detail Table
DID MID Credit Card
1 1 Visa Card
2 1 Master Card
3 2 Visa Card
4 3 Visa Card
5 3 Master Card
and I want report something like this:
================================= Description Credit Card
================================= Person -1 Visa Card, Master Card
Person â' 2 Master Card
Person â' 3 Visa Card, Master Card
Now I am not sure this is possible in Reporting Services.You will have to write an SP which returns data in the format you want.
>--Original Message--
>I have two tables, which you can call master and details. I want to pull data >from master table and respective details from details table. Here are tables >and data information.
>Master Table
>MID Description
>1 Person =E2?" 1
>2 Person -2 >3 Person =E2?" 3
>Detail Table
>DID MID Credit Card
>1 1 Visa Card
>2 1 Master Card
>3 2 Visa Card
>4 3 Visa Card
>5 3 Master Card
>
>and I want report something like this:
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D=3D=3D=3D=3D=3D=3D=3D=3D
>Description Credit Card
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D==3D=3D=3D=3D=3D=3D=3D=3D=3D
>Person -1 Visa Card, Master Card
>Person =E2?" 2 Master Card
>Person =E2?" 3 Visa Card, Master Card
>
>Now I am not sure this is possible in Reporting Services.
>.
>|||You'd have to join the two tables. Take a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sa-ses_1l4j.asp?frame=true
for examples.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Sam B" <SamB@.discussions.microsoft.com> wrote in message
news:29AF9D45-CAFE-4749-9754-E5B6EA0DC660@.microsoft.com...
> Thanks for your quick response.
> Now I am not clear how would I do that, can you please provide me some
hints?
> "anonymous@.discussions.microsoft.com" wrote:
> > You will have to write an SP which returns data in the
> > format you want.
> >
> > >--Original Message--
> > >I have two tables, which you can call master and details.
> > I want to pull data
> > >from master table and respective details from details
> > table. Here are tables
> > >and data information.
> > >
> > >Master Table
> > >
> > >MID Description
> > >1 Person â?" 1
> > >2 Person -2
> > >3 Person â?" 3
> > >
> > >Detail Table
> > >
> > >DID MID Credit Card
> > >1 1 Visa Card
> > >2 1 Master Card
> > >3 2 Visa Card
> > >4 3 Visa Card
> > >5 3 Master Card
> > >
> > >
> > >and I want report something like this:
> > >
> > >=================================> > >Description Credit Card
> > >=================================> > >Person -1 Visa Card, Master Card
> > >Person â?" 2 Master Card
> > >Person â?" 3 Visa Card, Master Card
> > >
> > >
> > >Now I am not sure this is possible in Reporting Services.
> > >
> > >.
> > >
> >

No comments:

Post a Comment