0

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

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
4

0 回答 0