Im having trouble trying to calculate MonthBegin and MonthToDate.
For this task Im always looking at the previous week, if the previous week has two months in it then:
MB = The 1st of the current month
MTD = Last Sunday of the current week
MB = The 1st of last month.
MTD = Last Sunday of the previous week
If I run it on 2007-11-07 then
MB = 2007-11-01 and MTD = 2007-11-04
If I run it on 2007-08-01 then
MB = 2007-07-01 and MTD = 2007-07-29
I keep trying and trying but not going anywhere, will really appreciate any help or tips!