this is a bit out side the norm of "scheduling" but I am trying to derive a set of dates that match this logic and trying to some way make it as a black box approach as possible a recursive custom function because i need to possibly use it in a calculation in virtual list for a series for records.
I have a table of known holidays with a flag that determines its a "major" holiday were no work is done and lesser holidays where some work can be done.
My date cycle is a set of 4 inspections which i could pass in as a list, or pass a single Date (the actual treatment date)
theDate - 3 theDate - 1 theDate theDate + 1
7/1/14 7/3/14 7/4/14 7/5/14
Should a MAJOR holiday occur on exam 3 the it must be shifted 1 day forward along with exam 4
Should a MAJOR holiday occur on exam 1 OR exam 2 these can bet shifted one day prior, but they don't need to move in tandem.
If a minor holiday occurs on exam 1, 2, or 4 the dates are fine but if a minor holiday occurs on the 3rd exam then it will be shifted forward one day along with the 4th exam.
So for example this week the result would be this returned list of dates:
7/1/14 7/3/14 7/5/14 7/6/14
I possibly could pass in a valueList of the known holiday data derived at an earlier point so that the function has all it needs so that it doesn't have to do an SQL query. ( i am thinking if I need to put this function in a calculation on my virtual list.
HolidayShift ( theDate ; MajorHolidayList ; MinorHolidayList )
Edited by Ocean West, 05 July 2014 - 07:25 PM.