Solved

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

Posted on 2008-06-24
8
776 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
[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
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
Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

 
LVL 5

Accepted Solution

by:
catherinelouise earned 168 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 166 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 166 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

763 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