Skip to main content

Unable to expire holiday rule: You cannot expire a holiday rule that is in use by an active career or holiday year.

You cannot expire a holiday rule that is in use by an active career or holiday year.

H
Written by Harry Ledger
Updated over 3 months ago

This indicates that you may have an employee who still has the holiday rule assigned to one of their active career or holiday history records.
​
You should check the current tab of the holiday rule to ensure no employees are assigned the holiday rule.
​
You may also need to run a data export to check if the Holiday Rule you are trying to expire is currently on a career record. To do so, follow these steps.

  1. Log in to the SelectHR Administrator Tool.

  2. Click Import/Export Data.

  3. Click Create an export definition.

  4. Click Select the data to export.

  5. Change the database to SelectHR.

  6. Log in.

  7. Copy the below SQL:

  8. ;WITH Expired AS (SELECT * FROM Absence.[Holiday Rules] WHERE [Expiry Date] IS NOT NULL) SELECT holidayRule.[Holiday Rule Number], holidayRule.[Holiday Rule], holidayRule.[Expiry Date], holidayYear.[Holiday History Number], holidayYear.[Year], holidayYear.[Holiday Year Start], holidayYear.[Holiday Year End]         FROM             Expired holidayRule             JOIN Absence.[Holiday History Data] holidayYear ON holidayRule.[Holiday Rule] = holidayYear.[Holiday Rule]             JOIN (                 -- get career start and end dates for careers that inherit rule from the holiday year                 SELECT                     eah.[Person Number],                     ech.[Appointment Number],                     ech.[Career Number],                     ech.[Effective Date] [Career Start Date],                     CASE WHEN eah.[End Date] < DATEADD(DAY,-1,ISNULL(LEAD(ech.[Effective Date],1,NULL) OVER (PARTITION BY ech.[Appointment Number] ORDER BY ech.[Effective Date] ASC), '2099-12-31'))                         THEN eah.[End Date]                         ELSE DATEADD(DAY,-1, LEAD(ech.[Effective Date],1,NULL) OVER (PARTITION BY ech.[Appointment Number] ORDER BY ech.[Effective Date] ASC))                     END AS [Career End Date]                 FROM        Employee.[Career History] ech JOIN Employee.[Appointment History] eah ON ech.[Appointment Number]=eah.[Appointment Number]                 WHERE ech.[Effective Date] <= ISNULL(eah.[End Date], ech.[Effective Date])                     AND ech.Workflow = 1                     AND ech.HolidayRuleNumber IS NULL -- no overriding career rule             ) careerDates ON holidayYear.[Person Number] = careerDates.[Person Number]                             AND careerDates.[Career Start Date] <= holidayYear.[Holiday Year End]                             AND ISNULL(careerDates.[Career End Date], holidayYear.[Holiday Year End]) >= holidayYear.[Holiday Year Start]         WHERE                 holidayRule.[Expiry Date] < holidayYear.[Holiday Year End] -- if the rule expires on the last day of the year any still active careers using it will be caught in the next year             AND                 (careerDates.[Career End Date] IS NULL OR careerDates.[Career End Date] > holidayRule.[Expiry Date])
  9. In the top left of the data export window, click Options, Paste SQL from clipboard.

  10. Click Data.

If the holiday rule you are trying to expire is in the data, you will need to go to the employees career history record and remove the holiday rule from the holiday rule field.

Did this answer your question?