We use an odd work week and I need to create reports based on the Thursday - Wed schedule. I am using 8.5 and am trying to modify the following formula to break on Thursday rather than Friday as it does currently (this formula was from the Business Objects support site). My dyslexic brain keeps modifying it such that I get a Thursday and Friday break. Can anyone please help my tired brain, thanks in advance.
if dayofweek({Table.Field}) = [1,2,3,4,5] then
(numbervar x := (-(dayofweek({Table.Field}) + 1));
(dateadd("d", x, {Table.Field})))
else
if dayofweek({Table.Field})=6 then
({Table.Field})
else
if dayofweek({Table.Field})=7 then
(dateadd("d", -1 ,{Table.Field}))
if dayofweek({Table.Field}) = [1,2,3,4,5] then
(numbervar x := (-(dayofweek({Table.Field}) + 1));
(dateadd("d", x, {Table.Field})))
else
if dayofweek({Table.Field})=6 then
({Table.Field})
else
if dayofweek({Table.Field})=7 then
(dateadd("d", -1 ,{Table.Field}))