Addressed Exceptions Reasoncode Report
Report that identifies employees with addressed exceptions based on specific reason codes within a specified date range, focusing on tracking LFE and LTE unexcused exceptions
Parameters
{mindate}- Start date for the report period (example: '2024-08-04'){maxdate}- End date for the report period (example: '2024-08-10')
Note: The script uses placeholder parameters {mindate} and {maxdate} for integration with reporting tools.
Data Components
The report analyzes:
- Employee Information - Employee identification and name details
- Exception Details - Effective date and reason code information
- Reason Classification - Description of exception types from the Reasons table
Output Format
| Column | Description |
|---|---|
| lastname | Employee's last name |
| FIRSTNAME | Employee's first name |
| EFFDATE | Effective date of the exception |
| ADDRESSED | Reason description or 'Not Addressed' if null |
Reason Codes Tracked
The report specifically filters for:
- Reason Code 13 - LFE - Unexcused (Left Early)
- Reason Code 17 - LTE - Unexcused (Left Late)
Technical Implementation
The script uses:
- LEFT JOINs - To combine employee, exception, and reason data
- Reasons table lookup - Dynamic reason description retrieval instead of hardcoded values
- ISNULL function - To handle cases where reason descriptions are not found
- Date range filtering - Using BETWEEN clause for the specified period
- Reason code filtering - Using IN clause to focus on specific exception types
- ORDER BY - Results sorted by effective date (descending) and last name
Key Features
- Dynamic Reason Lookup - Uses the Reasons table for maintainable reason descriptions
- Flexible Exception Tracking - Easily extensible to include additional reason codes
- Comprehensive Employee Data - Includes full employee name information
- Date-Ordered Results - Most recent exceptions appear first
Use Cases
- Exception Auditing - Track which unexcused exceptions have been properly addressed
- Compliance Monitoring - Ensure proper handling of attendance violations
- Management Reporting - Provide visibility into exception resolution patterns
- HR Analysis - Identify trends in employee attendance issues
T-SQL
Select
e.lastname,
e.FIRSTNAME,
s.EFFDATE,
ISNULL(r.DESCR, 'Not Addressed') as ADDRESSED
From Supedithist s
left join employees E
on s.filekey = e.filekey
left join Reasons r
on s.REASON = r.num
where s.EFFDATE between {mindate} and {maxdate}
and s.REASON in (13,17)
order by 3 DESC,1Content Inventory
- Doc File:
content/docs/reports/employee_information/addressed_exceptions_reasoncode.mdx - SQL Script:
SQL/reports/employee_information/addressed_exceptions_reasoncode.sql