Solved

Call Dataset B From Dataset A

Posted on 2008-06-26
4
421 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 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