Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / June 2006

Tip: Looking for answers? Try searching our database.

Column Value Lookup

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Terry - 28 Jun 2006 15:01 GMT
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  

Thank you.
Kaisa M. Lindahl Lervik - 28 Jun 2006 16:20 GMT
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
> What is the best way to lookup a value in a column from another data set?
>
[quoted text clipped - 7 lines]
>
> Thank you.
Terry - 28 Jun 2006 19:14 GMT
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

> 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
[quoted text clipped - 14 lines]
> >
> > Thank you.
Matt - 29 Jun 2006 04:03 GMT
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

> In the Task table, employees are identified as numeric values. References to
> the actual employee names are found in the Employee table.
[quoted text clipped - 29 lines]
> > >
> > > Thank you.
Terry - 29 Jun 2006 16:26 GMT
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

> 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
[quoted text clipped - 39 lines]
> > > >
> > > > Thank you.
Matt - 30 Jun 2006 02:18 GMT
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.

> 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
[quoted text clipped - 64 lines]
> > > > >
> > > > > Thank you.
Terry - 30 Jun 2006 12:25 GMT
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

> Ok, it sounds you are"...trying to locate and display the employee name based
> on the employee id found in another data set."
[quoted text clipped - 77 lines]
> > > > > >
> > > > > > Thank you.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.