Solved

Call Dataset B From Dataset A

Posted on 2008-06-26
4
422 Views
Last Modified: 2008-09-17
I am going to have a dataset which will calculate a date, call it dataset A.  My dataset B which will return all records since that date.

So how can I say something like
where date > datasetb.date or something?
0
Comment
Question by:Fraser_Admin
  • 3
4 Comments
 
LVL 2

Expert Comment

by:MapleMale
ID: 21876364
Use a stored procedure and temp tables. Dataset A will be the only data set. Then have a veraible,  @Date or something which you use to store your calculated date. So your where clause would look like this:

Declare @Date datetime

Set @Date = (select mydate field from mytableb where mycolumn = mywhereclause)

Select * from mytable
where date > @Date
0
 
LVL 2

Expert Comment

by:MapleMale
ID: 21876370
** your SP, not Where clause would look like this.... sorry! typo!
0
 

Author Comment

by:Fraser_Admin
ID: 21877075
how do i use a sp with reporting services?
0
 
LVL 2

Accepted Solution

by:
MapleMale earned 500 total points
ID: 21879256
Go to the Data Tab where you would normally type your SQL Query. Type Exec [name of your SP] [parameters if any seperated by commas]. For example:

EXEC [MyEmployeeRankingsSP] @StartDate, @EndDate

The first time you execute that in SSRS, it will create report parameters named after the SP parameters of @StartDate and @EndDate. Run it once and your field names wil be available to add to the report as well.

Note: You could also skip the whole sp idea and change your command type in the data tab to Stored Proc. This will allow you to use SP type SQL code in the query window instead of standard select statements. This all depends on where you would your code to be executed. Do you want to the put processing load on your database engine or on the reporting server? Those are best practice questions you should ask your DBA.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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