Basically, I am writing an SQL (that will be turned into SQR) that will create a report whenever there is a change in a employee's status related to one of the sales teams. The issue I am having now is that if an employee transfers out of one of the associated departments, I need it to be part of the report saying so, which means I need to cross check the EMPLID with the DEPTID and LASTUPDDTTM to see if they came from sales first, here is and idea of what I'm trying:
If $ACTION = 'XFR'
EVALUATE $DEPTID
WHEN ='0111'
WHEN ='0222'
WHEN ='0444'
WHEN ='0333'
WHEN ='0555'
LET $ACTION_DESCR =('Transfer-In')
do Write-Line
!WHEN -OTHER (check syntax)
!Do CheckTransferOut
END-EVALUATE
ELSE
EVALUATE $ACTION
WHEN ='ADD'
WHEN ='HIR'
WHEN ='POS'
WHEN ='PRO'
WHEN ='REH'
WHEN ='RET'
WHEN ='TER'
WHEN ='TWB'
WHEN ='TWP'
EVALUATE $DEPTID
WHEN ='0111'
WHEN ='0222'
WHEN ='0444'
WHEN ='0333'
WHEN ='0555'
do Write-Line
END-EVALUATE
END-EVALUATE
END-IF