Solved

SSRS 2008 Combine Two Data Sources in One Report

Posted on 2010-08-26
3
946 Views
Last Modified: 2012-06-27
Experts, I am trying to combine two data sets in one report that share a common ID called "Order". I have both data sets setup and the tablix in the report. One data source hold Date info about Projects and the other holds cost. The cost dataset is returning empty when I run it. Here is the code I'm using for it. I dont think I'm using the WHERE IN clause correctly. I'm not an SQL programmer so please dumb it down for me
SELECT     [Project ID], [Project Description], [Planning Order], [Order], [Shared/Specifc], AuthAmt, [Actuals to Date], FAC, [Rmng Fcst], [EOY Budget/Plan], 

                      [2010 YTD Actuals], [EOY Fcst]

FROM         EPMSAPExcel

WHERE     ([Order] IN ('" + Join(Parameters!OrderNumbers.Value, "', '")+"'))

Open in new window

0
Comment
Question by:hunew
3 Comments
 
LVL 16

Accepted Solution

by:
vdr1620 earned 500 total points
ID: 33538621
I created a sample code for you below..Also, Suggest use to check the below links on SSRS - SQL Query with parameters and Joins in SQL ..which will help you re write your query correctly
 
http://www.sql-server-performance.com/articles/reporting/report_parameters_p2.aspx

http://www.codeproject.com/KB/database/SqlServerJoins.aspx
SELECT     [Project ID], [Project Description], [Planning Order], [Order], [Shared/Specifc], AuthAmt, [Actuals to Date], FAC, [Rmng Fcst], [EOY Budget/Plan], 

                      [2010 YTD Actuals], [EOY Fcst]

FROM         EPMSAPExcel E 

INNER JOIN TAble B        -----( Replace it with your tableName) 

ON E.order = B.Order      -- (Joining on matching columns)

WHERE     (E.[Order] IN (@Parameter)

Open in new window

0
 

Author Comment

by:hunew
ID: 33546646
Thanks but the Table B you mention above is a different dataset in my case. how I can refer to it?
0
 
LVL 26

Expert Comment

by:Chris Luttrell
ID: 33546886
I am afraid you cannot join the data from two separate datasets inside of RS, you will have to do that at the database level via your original query or stored procedure.  You can nest objects in RS or create subreports where the inner object uses a value from the outer object as a parameter to gather data to display, but it is nested something like this not Joined.

Customer 1    Name     Address
Some other customer 1 summary data
       Customer 1 Order Data
       Date        Quantity           Price
       1/1/10     100               $500.00
       2/2/10     300             $1250.00
Customer 2    Name     Address
Some other customer 2 summary data
       Customer 2 Order Data
       Date        Quantity           Price
       2/1/10     50                $500.00
       2/2/10     100             $1250.00
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now