0

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
  • Not quite sure what you're asking. As far as the syntax above, why not have the XFR action within the Evaluate $Action block? Also don't see the LASTUPDTTIME field anywhere in your code. Can you explain what you need please? – cardmagik Oct 27 '16 at 18:33
  • I didn't add the let $ to the example, what I'm asking is I have departments where people were transferred to different departments outside of the sales department, meaning they were transferred out, i need to check their employee ids to see if they were part of sales before transferring to add to the csv report i have created – Aspirational Developer Oct 28 '16 at 16:51

0 Answers0