all groups > sql server reporting services > june 2006 >
You're in the

sql server reporting services

group:

Column Value Lookup


Column Value Lookup Terry
6/28/2006 7:01:02 AM
sql server reporting services: What is the best way to lookup a value in a column from another data set?

I am trying to locate and display the employee name based on the employee id
found in another data set.

I.E.
13 = Terry Ward
14 = Peter Jackson

Re: Column Value Lookup Terry
6/28/2006 11:14:02 AM
In the Task table, employees are identified as numeric values. References to
the actual employee names are found in the Employee table.

SELECT dbo.tblIssue.Opened_Date, dbo.tblEmployee.Name,
dbo.tblIssue.Opened_By,
dbo.tblIssue.Issue_Summary, dbo.tblIssue.Issue_Description,
dbo.tblIssue.Targeted_Date, dbo.tblIssue.Status,
dbo.tblIssue.Closed_Date
FROM dbo.tblIssue
INNER JOIN
dbo.tblEmployee ON dbo.tblIssue.Assigned_To =
dbo.tblEmployee.Employee_ID
INNER JOIN
dbo.tblStatus ON dbo.tblIssue.Status = dbo.tblStatus.Status_Name

[quoted text, click to view]
Re: Column Value Lookup Kaisa M. Lindahl Lervik
6/28/2006 5:20:33 PM
I might be wrong, but I don't think you can do that, unfortunately.
You need to make the EmployeeID a parameter that you can use to query your
employee database table for names.

What are you trying to do? Might be a different way of doing it.

Kaisa M. Lindahl Lervik
[quoted text, click to view]

Re: Column Value Lookup Matt
6/28/2006 8:03:02 PM
Can you join the Task table to the emloyee table similar to the way the
tblIssue table is joined to the tblEmployee table is below to return the
employee name?

e.g. Something like this...
SELECT dbo.tblEmployee.Name
FROM tblTask
JOIN tblEmployee
ON tblTask.Employee_ID = tblEmployee.Employee_ID

[quoted text, click to view]
Re: Column Value Lookup Terry
6/29/2006 8:26:01 AM
Do I need to create a new dataset and include the employee name in the report
in order to obtain the employee name along with the existing dataset called
IT_Projects?

DATASET 1:

SELECT dbo.tblIssue.Opened_Date, dbo.tblEmployee.Name,
dbo.tblIssue.Opened_By,
dbo.tblIssue.Issue_Summary, dbo.tblIssue.Issue_Description,
dbo.tblIssue.Targeted_Date, dbo.tblIssue.Status,
dbo.tblIssue.Closed_Date
FROM dbo.tblIssue
INNER JOIN
dbo.tblEmployee ON dbo.tblIssue.Assigned_To =
dbo.tblEmployee.Employee_ID
INNER JOIN
dbo.tblStatus ON dbo.tblIssue.Status = dbo.tblStatus.Status_Name

DATASET 2:

SELECT dbo.tblEmployee.Name
FROM tblTask
JOIN tblEmployee
ON tblTask.Employee_ID = tblEmployee.Employee_ID

[quoted text, click to view]
Re: Column Value Lookup Matt
6/29/2006 6:18:01 PM
Ok, it sounds you are"...trying to locate and display the employee name based
on the employee id found in another data set."

So, it sounds like you have 1 dataset that does not return the employee name
and another dataset that does return the employee name. Instead of trying to
perform a lookup between the 2 datasets that you have, the best thing to do
would be to modify the query that currently does not include the employee
name to include the employee name in the select statement. Does that make
more sense?

If you want to post the 2 dataset queries that you have, that may help me
understand your situation better.

[quoted text, click to view]
Re: Column Value Lookup Terry
6/30/2006 4:25:01 AM
Thank you for your speedy response.

However, please review the following 2 dataset queries being used.

How can I include the employee name without causes JOIN conflicts?

DATASET 1:

SELECT dbo.tblIssue.Opened_Date, dbo.tblEmployee.Name,
dbo.tblIssue.Opened_By,
dbo.tblIssue.Issue_Summary, dbo.tblIssue.Issue_Description,
dbo.tblIssue.Targeted_Date, dbo.tblIssue.Status,
dbo.tblIssue.Closed_Date
FROM dbo.tblIssue
INNER JOIN
dbo.tblEmployee ON dbo.tblIssue.Assigned_To =
dbo.tblEmployee.Employee_ID
INNER JOIN
dbo.tblStatus ON dbo.tblIssue.Status = dbo.tblStatus.Status_Name

DATASET 2:

SELECT dbo.tblEmployee.Name
FROM tblTask
JOIN tblEmployee
ON tblTask.Employee_ID = tblEmployee.Employee_ID


[quoted text, click to view]
AddThis Social Bookmark Button