Using Oracle PL/SQL I need to calculate a start date for a task using the due date and the working hours required to finish the task.
Given 24-JUL-2012 17:00 as a due date and 20 hours as hours needed to complete the task and using working hours of 8AM-5PM (1 hour lunch – so 8 hours per day max) I need to figure out in PL/SQL what the start date/time would be… which should come out to 22-JUL-2012 13:00.
The following code could be a starting point:
Note that the function does not consistently consider lunch time. You’ll need to define exactly when lunch time is and adapt the function accordingly.