Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I have found your site brilliant. What makes it good are the people that contribute to the site..."

Geography

Where in the world do Tek-Tips members come from?
ttrsnoob (TechnicalUser)
14 Apr 10 9:25
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)
CharlesCook (Programmer)
21 Apr 10 14:12
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

FireGeek21 (TechnicalUser)
22 Apr 10 16:19
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

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!

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