Sage 100

 View Only
  • 1.  Crystal Report to Detect MISSING Employees

    Posted 05-30-2024 15:15

    Client has 200+ employee PR.  They are asking for a report that lists MISSING employees in the PR Data Entry.  Looking for a way to detect the MIA's.  Am I missing something?



    ------------------------------
    Jeff Schwenk
    Bottomline Software, Inc.
    (540) 221-4444
    ------------------------------


  • 2.  RE: Crystal Report to Detect MISSING Employees

    Posted 05-31-2024 10:45

    ChatGPT will write/debug most of this in Crystal Reports for you. It's not always 100% but it will get you really close and cut down on any trial and error.

    Try a prompt like this: 

    Client has 200+ employee PR.  They are asking for a report that lists MISSING employees in the PR Data Entry.  Looking for a way to detect the MIA's.  Am I missing something?

    Relevant table for the customer master is PR_Employee and we'd want to test the the field EmployeeStatus="A" (for active ) and use this master table against the payroll data entry to see if an employee is NOT in the payroll data entry table - PR_PayrollHeader -- can you write the join that  I need to show me all employees in the PR_Employee whose EmployeeStatus="A" and are NOT in PR_PayrollHeader. I want to use this as a Crystal Report select.



    ------------------------------
    Wayne Schulz
    wayne@s-consult.com
    Schulz Consulting
    (860) 516-8990
    Moodus, CT
    ------------------------------



  • 3.  RE: Crystal Report to Detect MISSING Employees

    Posted 06-03-2024 01:08
    Edited by Dan Burleson 06-03-2024 01:10

    Using Wayne's prompt ChatGBT gave me:

    SELECT e.EmployeeID, e.EmployeeName, e.EmployeeStatus
    FROM PR_Employee e
    LEFT JOIN PR_PayrollHeader p ON e.EmployeeID = p.EmployeeID
    WHERE e.EmployeeStatus = 'A'
      AND p.EmployeeID IS NULL;

    While impressive, even changing EmployeeID to EmployeeKey and EmployeeName to LastName it doesn't get the linking correct. Plus I needed to add the Payroll Header EmployeeID in addition to the PR_Employee one when entering this into a connection command which is the only place I know where to enter SQL directly into Crystal.

    What works is:

     SELECT e.EmployeeKey, e.LastName, e.EmployeeStatus, p.EmployeeKey
     FROM   {oj PR_Employee e LEFT OUTER JOIN PR_PayrollHeader p ON e.EmployeeKey=p.EmployeeKey}
     WHERE e.EmployeeStatus='A' AND p.EmployeeKey IS  NULL 

    I use ChatGBT extensively, but mostly for generating small algorithms.



    ------------------------------
    Dan Burleson
    Software Consultant
    Connex Software
    Corvallis OR
    541-224-6642
    ------------------------------



  • 4.  RE: Crystal Report to Detect MISSING Employees

    Posted 06-04-2024 18:54
    Might need to alias that second EmployeeKey in the first line.  I forget if Crystal will throw an error or not.
    
    SELECT e.EmployeeKey, e.LastName, e.EmployeeStatus, p.EmployeeKey AS EmpKey2


    ------------------------------
    Chris St. Amand
    Arizona Accounting & Information Systems
    ------------------------------