how to get the max accrual proc date that is <= another field in PSQUERY
Hi All,
When I try to get the max ACCRUAL_PROC_DT from the LEAVE_ACCRUAL record, in the subquery it will not allow me to compare against a date from a different record as I need to.
Below is my example from SQL*PLUS, that I cannot get to happen in PSQUERY:
and f.accrual_proc_dt =(select max(f1.accrual_proc_dt)
from ps_leave_accrual f1
where f1.emplid = f.emplid
and f1.company = f.company
and f1.plan_type= f.plan_type
and f1.accrual_proc_dt <= a.pay_end_dt)
Even though the PAY_CALENDAR record is in the query, and the PAY_END_DT is a field in the query, I am unable to select this in the subquery.