基本上,我正在编写一个SQL(将转换为SQR),只要员工与其中一个销售团队相关的状态发生变化,就会创建报告。我现在遇到的问题是,如果一名员工转出一个相关部门,我需要将其作为报告的一部分,这意味着我需要与DEPTID和LASTUPDDTTM交叉检查EMPLID,看看他们是否首先来自销售,这是我正在尝试的想法:
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