Could someone explain exactly what the formula below means. I am working on a report that was written by someone else. I need to change the report to report on closed issues from the prior Monday to Sunday and send the report on the following Monday. However, if the report is run on any other day, it should only report on the prior Monday's issues through the upcoming Sunday.
This formula is for issues from the prior Thursday to Wednesday and sends the report out on Friday.
if DayofWeek(currentdate,crFriday) = 1 then
currentdate - DayofWeek(currentdate,crFriday)-7
else currentdate - DayofWeek(currentdate,crFriday)
if DayofWeek(currentdate,crFriday) = 1 then
currentdate - DayofWeek(currentdate,crFriday)-1
else currentdate - DayofWeek(currentdate,crFriday)+6