Solved

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

Posted on 2008-06-24
8
766 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 5

Accepted Solution

by:
catherinelouise earned 168 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now