Solved

Call Dataset B From Dataset A

Posted on 2008-06-26
4
424 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
In this article I will describe the Backup & Restore 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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

728 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