G
Guest
I could use some help with manipulating existing dates around weekends and
holidays. In other words, I have existing dates that need to be changed so
that they only fall on a workday. I need to write a routine that will do the
following:
1) Evaluate an existing date in a table field;
2) If that date is a weekend or holiday, change the date to the next
available workday date (not a weekend or holiday).
I already have 3 tables that I believe are all that may be needed:
1) one that contains all dates through 2040 [2000-2040];
2) one that lists out the known federal holidays [ref_FederalHolidays];
3) one that only lists workdays [tbl_WorkdaysOnly]. This table includes a
field that has a consecutive incremental number that I already use for
calculating elapsed workdays.
I am in the federal employment arena, thus I created this scheme so that
when our esteemed leaders 'declare' an otherwise normal workday as a holiday,
I can recreate the WorkdaysOnly table on the fly.
At this point, I only need this as a DBA tool for cleaning up existing data
prior to a migration. I appreciate any help you can provide.
holidays. In other words, I have existing dates that need to be changed so
that they only fall on a workday. I need to write a routine that will do the
following:
1) Evaluate an existing date in a table field;
2) If that date is a weekend or holiday, change the date to the next
available workday date (not a weekend or holiday).
I already have 3 tables that I believe are all that may be needed:
1) one that contains all dates through 2040 [2000-2040];
2) one that lists out the known federal holidays [ref_FederalHolidays];
3) one that only lists workdays [tbl_WorkdaysOnly]. This table includes a
field that has a consecutive incremental number that I already use for
calculating elapsed workdays.
I am in the federal employment arena, thus I created this scheme so that
when our esteemed leaders 'declare' an otherwise normal workday as a holiday,
I can recreate the WorkdaysOnly table on the fly.
At this point, I only need this as a DBA tool for cleaning up existing data
prior to a migration. I appreciate any help you can provide.