Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Simple Select Expert Question Post Reply Post New Topic
Author Message
Squarro
Newbie
Newbie


Joined: 28 Jan 2010
Online Status: Offline
Posts: 2
Quote Squarro Replybullet Topic: Simple Select Expert Question
     Posted: 28 Jan 2010 at 11:46am
Cr 2008
 
I have two tables, and I want to select a record from one table by matching a field from another table, using the the Select Expert
 
I want to print a specific Employee Title from the Employee table, selected by matching the EmployeeID field in the Employee table to the same value in the EmployeeID field in the Project table.
 
So the fields in question are:
Employee.EmpTitle (the field I want to display on the report)
Project.EmployeeID
Employee.EmployeeID
 
What do I put in the Select Expert to select the correct Employee.EmployeeID?
 
Thanks for your help.
 
 
IP IP Logged
davejwhite
Newbie
Newbie


Joined: 19 Jan 2010
Online Status: Offline
Posts: 34
Quote davejwhite Replybullet Posted: 29 Jan 2010 at 1:01am
Hi,
 
Unless I'm missing something in your explanation, this should be easily possible once the tables are set up in the report. In the Database Expert, if both your Project and Employee fitables are there, and they are linked by the EmployeeID field (if they aren't, you can join them by dragging and dropping from field to field), You should be able to add the Employee Title field directly on to your report from the Field Explorer.
IP IP Logged
Squarro
Newbie
Newbie


Joined: 28 Jan 2010
Online Status: Offline
Posts: 2
Quote Squarro Replybullet Posted: 29 Jan 2010 at 5:12am
The tables are joined and I can
indeed drag the field onto the report, but the wrong employee
s information is displayed.

This report is an invoice. It summarizes each employee's time on a particular project. There is a single project manager per project (stored as a number in project.employeeid). I want to display the project manager's name (stored in employee.emptitle). The tables are joined indirectly through employee.employeeid).

In my first attempts I've added employee.employeeid to the report, and in the select expert specified {project.employeeid}={employee.employeeid}. The problem is that rather than displaying the name of the specific project manager, it displays the name of the first employee to have time listed on the invoice.

Thanks
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 01 Feb 2010 at 1:15pm
Looks to me like there should be a different field in the project table that would show the manager's name (i.e., though the employee table).  Without knowing the data, it is difficult to track down the issue.
IP IP Logged
davejwhite
Newbie
Newbie


Joined: 19 Jan 2010
Online Status: Offline
Posts: 34
Quote davejwhite Replybullet Posted: 03 Feb 2010 at 3:23am
How does the Project know who its Manager is? Is there a ProjectManagerID field in the Project table?
 
In which case you need to add another instance of the Employee table (and alias it) and connect the ID fields using that one. then you can use the Manager data.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum