This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CASE | |
| /* LEAVE BRANCH */ | |
| WHEN cef.id IS NOT NULL THEN | |
| CASE | |
| WHEN cef.start_date IS NULL OR cef.end_date IS NULL | |
| THEN 'leave_has_no_period' | |
| WHEN DATEDIFF(DATE(cef.end_date), DATE(cef.start_date)) > 0 | |
| THEN 'period_spans_multiple_days' | |
| WHEN EXISTS ( | |
| SELECT 1 |