January 19, 2009 at 9:02 am
I've a report with several Datasets.
I'dd like to share data between datasets, to fill parameters.
example:
Dataset 1:
use db1
select debnr from site where name='customername'
Dataset 2:`
use db2
select sitename from customer where sitename=@P_CCode
I'dd like to fill @P_CCode with the data from debnr from db1
Is this possible?
January 19, 2009 at 7:22 pm
No need for a variable, at all...
SELECT SiteName
FROM db2.dbo.Customer c2
INNER JOIN db1.dbo.Site s1
ON c2.SiteName = s1.Debnr
WHERE s1.Name = 'CustomerName'
--Jeff Moden
Change is inevitable... Change for the better is not.
January 20, 2009 at 12:00 am
I'm assuming you are using SQL Reporting Services. If that is correct then, yes, you can use the selection from query 1 to populate the parameter for query 2. I assume that query 1 is populating a parameter, let's call it SiteName. In your dataset for query 2 you need to go into properties and to the parameters tab and assign the report parameter SiteName to provide the value for the query parameter @P_CCode.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
January 20, 2009 at 6:54 am
Yes, I'm using ReportServer and I'm using the parameters to make selections, so I need them.
I'll try the method of Jeff, to fill my parameter.
If it doesn't work, I'll come back.
Thanks in advance.
January 20, 2009 at 9:30 pm
htilburgs (1/20/2009)
Yes, I'm using ReportServer and I'm using the parameters to make selections, so I need them.I'll try the method of Jeff, to fill my parameter.
If it doesn't work, I'll come back.
Thanks in advance.
Jack must be a mind reader. I had no idea it was for reporting services. You should probably try his method, first. Mine was for straight-up T-SQL.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply