Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to access a field in a dataset from the other dataset query in ssrs?.

Posted on 2008-06-24
8
Medium Priority
?
781 Views
Last Modified: 2008-09-14
I Need to access a field in a dataset from the other dataset in SSRS. can anyone tell me how to do it?
0
Comment
Question by:mshan
8 Comments
 
LVL 5

Expert Comment

by:catherinelouise
ID: 21857965
I have done this recently using the following syntax

(Fields!Field.Value, "DataSetName")

I believe you need to use aggregate functions with this data however, in my case I was retrieving a min and max value - do you need to get a single value?
0
 
LVL 5

Expert Comment

by:catherinelouise
ID: 21858100
I beg your pardon - I think I misunderstood your question actually, do you want a value from dataset A to appear in the actual query of dataset B?
0
 

Author Comment

by:mshan
ID: 21858388
Yes.Exactly.I have 2 datasets A and B each pulls data from 2 different functions.I need to get a field from A through dataset B. query in dataset A gives 4 columns and query in B gives 3 columns.I want to get a column from A in B along with its 3 columns
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
LVL 5

Accepted Solution

by:
catherinelouise earned 672 total points
ID: 21858841
I'm fairly sure this can't be done - a dataset is simply a query,and has the same syntax requirements that a query in query analyzer does.

If you need everything in one dataset for your report object, then I believe you need to find a  way to do this in the T-SQL.

Sorry!
0
 
LVL 12

Assisted Solution

by:jgv
jgv earned 664 total points
ID: 21858968
It can be done but it's pretty limited. You will need to use a function that includes the "scope" parameter. The scope must be the dataset name that you are trying to retrieve a field from. For example, this will retrieve the value of a field (SomeField) from the first record in another dataset (DatasetB).
=First(Fields!SomeField.Value, "DatasetB")

If you are trying to "join" the datasets so that you can include an extra column displaying another dataset's information then catherinelouise is correct that you would have to do this from the query.
0
 
LVL 18

Assisted Solution

by:chrismc
chrismc earned 664 total points
ID: 21859269
You can also do it through parameters, but you'd probably want to make it hidden.
This also assumes we are talking about just one value from dataset A.

When you set up a parameter you can say that it's default value comes from a dataset and then specify the field.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

927 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