LogoSupport Hub

Hourly Status History

Overview

Displays current and historical hourly status changes for employees, including effective dates.

SQL Code

hourly_status_history.sql
-- Current status from EMPLOYEES table
    SELECT
        E.FILEKEY,
        E.LASTNAME,
        E.FIRSTNAME,
        E.IDNUM,
        ST.NAME AS Status,
        E.STATUSEFFDATE AS EffectiveDate,
        'Current' AS RecordType
    FROM
        EMPLOYEES AS E
        LEFT JOIN STATUSTYPES AS ST ON E.STATUS = ST.NUM
UNION
ALL
    -- Historical status from EMPSTATUSHIST table
    SELECT
        E.FILEKEY,
        E.LASTNAME,
        E.FIRSTNAME,
        E.IDNUM,
        ST.NAME AS Status,
        H.EFFDATE AS EffectiveDate,
        'Historical' AS RecordType
    FROM
        EMPLOYEES AS E
        JOIN EMPSTATUSHIST AS H ON E.FILEKEY = H.FILEKEY
        LEFT JOIN STATUSTYPES AS ST ON H.STATUS = ST.NUM
ORDER BY
    LASTNAME ASC,
    FIRSTNAME ASC,
    RecordType ASC,
    EffectiveDate DESC;

Content Inventory

  • Doc File: content/docs/reports/employee_information/hourly_status_history.mdx
  • SQL Script: SQL/reports/employee_information/hourly_status_history.sql