Solved

Call Dataset B From Dataset A

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

758 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

20 Experts available now in Live!

Get 1:1 Help Now