I am working for a company that uses what they call "Block Dates or Block Months." What that means is that their months do not follow a regular month (i.e. first day of month - last day of month). Their months always start on a Sunday and end on a Saturday. Here is the kicker, if there is less than three working days in an ending week of the month, then that month ends early (that Saturday before) and the whole week (begins on that next Sunday) belongs to the next month. If there is more than three working days in that ending week, then that month will get the remainder, all the way to Saturday (even if it is in the next month).
Here are some examples: February 2015 is good since the 1st is on a Sunday and the 28th is on a Saturday. Fits perfectly.
May 2015 the month begins on the 3rd (Since the third is the first Sunday of the month) and ends on the 30th (Since it ends on a Saturday and there is not three working days in the next week that belong to that month). This means that the 31st of May will actually be the start date for the next month (June), but June will end on the 27th and the 28th will actually begin July.
December 2015 dates actually begin on November 29th (Sunday) and end January 2nd 2016 (Saturday).
So I need help to create a VBA script that would dynamically create a start date and end date using this type of logic or for a query to use the start date (stDate) and end date (EndDt) in a table that I created. I would like to use these dates in a WHERE clause and it would use the dates between that current "Block" month and not any previous "Block" months dates.
BlockMts Mnt StDate EndDt 1 1/4/2015 1/31/2015 2 2/1/2015 2/28/2015 3 3/1/2015 3/28/2015 4 3/29/2015 5/2/2015 5 5/3/2015 5/30/2015 6 5/31/2015 6/27/2015 7 6/28/2015 8/1/2015 8 8/2/2015 8/29/2015 9 8/30/2015 10/3/2015 10 10/4/2015 10/31/2015 11 11/1/2015 11/28/2015 12 11/29/2015 1/2/2016
Recap:
-The month always starts on a Sunday and ends on a Saturday (not necessarily in the same month)
-If the work week is less than three business days, then the week will end on the previous Saturday and next month will begin on that Sunday (again, not necessarily in the next month).
-Use these dates in a WHERE clause to query the “Block” month that we are currently in.
-Currently using Access 2013
Thank you in advance for all the help!