Solved

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

Posted on 2008-06-24
8
779 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

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…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how the fundamental information of how to create a table.

626 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