Try the following simplication of your formula:
if {@releases} in ['OnTime','Late'] then
if {oracle.actf} in LastFullMonth then
MonthName (Month({oracle.actf})) else
if date(year({oracle.actf}),month({oracle.actf}),01) =
date(year(currentdate),month(currentdate),01) then
"Wk"+totext(datepart("ww",{oracle.actf},crWednesday)+1-
datepart("ww",{oracle.actf}-day({oracle.actf})+1,crWednesday),0) else
if {oracle.actf} < Minimum(LastFullMonth) then
'Before' else
'After' else
if {@releases} = 'OnTimex' then
if {oracle.sfdate} in LastFullMonth then
MonthName (Month({oracle.sfdate})) else
if date(year({oracle.sfdate}),month({oracle.sfdate}),01) =
date(year(currentdate),month(currentdate),01) then
"Wk"+totext(datepart("ww",{oracle.sfdate},crWednesday)+1-
datepart("ww",{oracle.sfdate}-day({oracle.sfdate})+1,crWednesday),0)
else
if {oracle.sfdate} < Minimum(LastFullMonth) then
'Before' else
'After' else
select {oracle.sfdate}
case Next30Days :
'0-30 Days'
case Next31To60Days :
'31-60 Days'
case is > DateAdd('d',60,CurrentDatetime) :
'61+ Days'
case Aged0To30Days :
'A1-30 Days'
case Aged31To60Days :
'A31-60 Days'
default:
'A61+ Days';
You will have to decide how you want the week numbers to work. In this example, if Wednesday is the 4th of the month, then days 1 - 3 will be week 1, days 4 - 10 will be week 2, etc.
-LB