×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Display Manaagers EMPLID for each employee

Display Manaagers EMPLID for each employee

Display Manaagers EMPLID for each employee

(OP)
I have a number of departments.  In each department I have a manager.  What I am looking for is a report to list each of the employees in that department with the managers ID after each employee.

This is what I am trying
(SELECT ("B"."EMPLID")
FROM "PS_JOB" "B"
WHERE ( ("B"."EMPLID"="PS_JOB"."EMPLID")
AND   ("B"."EMPL_RCD_NBR"="PS_JOB"."EMPL_RCD_NBR")
AND   ("B"."DEPTID"="PS_JOB"."DEPTID")
AND   ("B"."JOBCODE"="PS_JOB"."JOBCODE")
AND   ("PS_JOB"."JOBCODE"='12104')
AND   ("PS_JOB"."EMPL_STATUS"='A') )
)

but when I try this nothing displays.  (It does have the correct number of records but nothing shows on the report)

RE: Display Manaagers EMPLID for each employee

This sounds like a Data Exception to me.  A Data Exception is invalid data in a field for example the letter A in a numeric field.  I would try to narrow down the selection to make sure the report is ok otherwise.  Then start looking for the bad data.

http://CharlesCook.com
Specializing in ReportSmith Training and Consulting

RE: Display Manaagers EMPLID for each employee

Hi TTRSNOOB,

First, a couple questions...  Are you putting this in a derived field?  If so, there are two rules:  1. Put () around the SQL - looks like you did that, 2. Put a space in front of every line of the SQL - don't ask why, I just know it works.

Also, I typically will put select criteria first in the WHERE clause and the linking at the end.  Only link on the key fields.  In the JOB table, the key fields are EMPLID and EMPL_RCD_NBR.  Here is your derived field:

(
 SELECT (B.EMPLID)
 FROM PS_JOB B
 WHERE (PS_JOB.JOBCODE = '12104')
  AND (PS_JOB.EMPL_STATUS = 'A')
  AND (B.EMPLID = PS_JOB.EMPLID)
  AND (B.EMPL_RCD_NBR = PS_JOB.EMPL_RCD_NBR)
)

If this is a formula in your Selection Criteria, I would approach this the same way, EXCEPT... you need to alter it a bit by turning it into an equation:

PS_JOB.EMPLID = (
 SELECT (B.EMPLID)
 FROM PS_JOB B
 WHERE (PS_JOB.JOBCODE = '12104')
  AND (PS_JOB.EMPL_STATUS = 'A')
  AND (B.EMPLID = PS_JOB.EMPLID)
  AND (B.EMPL_RCD_NBR = PS_JOB.EMPL_RCD_NBR)
)

Hope this helps!  Good Luck!

RSGeek

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close