Documente Academic
Documente Profesional
Documente Cultură
com
I use the Calendar Function to save the holidays that will affect the absences durations and may also
affect the overtime rates.
What I do is:
1. I save the Holidays like National Day on the calendar
2. use a SQL Function in my BG_ABSENCE_DUATION Formula that will check the duration based on
these saved Holidays.
9. Now you can search for it, delete it, or update it.
Hazem.elrefai@gmail.com
BEGIN
SELECT DISTINCT 1
INTO l_read_result
FROM per_calendar_entries
WHERE (TO_CHAR (l_date, 'DD-MON-YYYY') BETWEEN
start_date AND end_date);
EXCEPTION
WHEN NO_DATA_FOUND
THEN
count_days := count_days + 1;
END;
END IF;
l_date := l_date + 1;
-- if Sunday then start again
IF day_num = 7
THEN
day_num := 1;
ELSE
-- else next day
day_num := day_num + 1;
END IF;
END LOOP;
RETURN count_days;
END xx_count_working_days;
Hazem.elrefai@gmail.com
3. Add the following code to the BG_ABSENCE_DURATION Formula to calculate the duration after
subtracting the Holidays and Week Ends.
duration = to_char(duration_days)
Hazem.elrefai@gmail.com