Hi Theredia,
I have something that will work for you. First, some assumptions. I am assuming you are using the PS_JOB table and have PAYGROUP and FILE_NBR selected for your report or at least for query only. Next, if you don't already have a table alias assigned for this table, please assign a J as the alias. It's simple and hard to misspell.
Next, create a new derived field - I called mine HIRE_RATE.
Paste this into the formula box:
(
SELECT JOB.ANNUAL_RT
FROM PS_JOB JOB
WHERE (( (TO_CHAR(JOB.EFFDT, 'YYYYMMDD') || JOB.EFFSEQ = (
SELECT MIN(TO_CHAR(i.EFFDT, 'YYYYMMDD') || i.EFFSEQ)
FROM PS_JOB i
WHERE JOB.EMPLID = i.EMPLID
AND JOB.EMPL_RCD_NBR = i.EMPL_RCD_NBR)) AND
(JOB.PAYGROUP = J.PAYGROUP) AND
(JOB.FILE_NBR = J.FILE_NBR) ))
)
Remember the open and closed () and there should be a space before each line of the formula code.
This formula will select the ANNUAL_RT field from the PS_JOB table and give it the JOB alias. It is using a SELECT MIN SQL statement to get the minimum row from the PS_JOB table. The last two lines uses 2 key fields to connect itself back to the PS_JOB table you already have in your report.
I hope this helps. If you have any questions, feel free to contact me directly at RSGEEK @ WI . RR . COM
Tammy