Using a Date, Get the past Monday tmp:=CreatedOn; Rem {Monday is day 2}; tmpdayofwk:=@WeekDay(tmp); Rem {Get difference from Monday}; tmpdiff:=tmpdayofwk-2; Rem { if tmpdiff <0 then sunday and we need a week ago, else whatever tmpdiff is}; tmpdaysoff:=@If(tmpdiff<0; -6; tmpdiff * -1); @Adjust(tmp;0;0;tmpdaysoff;0;0;0) ________________________________________________________________ Using a Date, Get the Current Week, Last Week, and the Week Before (3 weeks total) tmp:=CreatedOn; or tmp:=@Date(@TextToTime("12/31/2003")); or tmp:=@Now; REM { get the first day of this year }; firstDay := @Date(@Year(tmp);1;1); lastDay:= @Date(@Year(tmp);12;31); REM { get the week, add 1 to increase from display from 0-51/52 to 1-52/53 There may be more than 52 weeks depending on how many days are in 1st week}; basewk := @Round((tmp - firstDay)/86400/7) + 1; lastwk:=@Round((lastDay - firstDay)/86400/7) + 1; baseyr:=@Year(tmp); REM{ calculate the previous weeks}; wk1:=@If(basewk-1<1; lastwk-basewk; basewk-1); yr1:=@If(basewk-1<1; baseyr-1; baseyr); wk2:=@If(basewk-2<1; lastwk-(basewk+1); basewk-2); yr2:=@If(basewk-2<1; baseyr-1; baseyr); @Implode((@Text(baseyr) + "-" + @Text(basewk)) : (@Text(yr1) + "-" + @Text(wk1)) : (@Text(yr2) + "-" + @Text(wk2)); ";") ________________________________________________________________ Using a Date, Get the Current Month, Last Month, and 2 Previous Months (4 months total) tmp:=@Date(@TextToTime("01/01/2003")); or tmp:=@Now; tmpm:=@Month(tmp); tmpy:=@Year(tmp); tmpmo:=@Right("0" + @Text(tmpm); 2); tmpyr:=@Text(tmpy); tmp1:=tmpm - 1; tmpmo1:=@Right("0" + @Text(@If(tmp1<1; tmp1+12; tmp1)); 2); tmpyr1:=@Text(@If(tmp1<1; tmpy-1; tmpy)); tmp2:=tmpm - 2; tmpmo2:=@Right("0" + @Text(@If(tmp2<1; tmp2+12; tmp2)); 2); tmpyr2:=@Text(@If(tmp2<1; tmpy-1; tmpy)); tmp3:=tmpm - 3; tmpmo3:=@Right("0" + @Text(@If(tmp3<1; tmp3+12; tmp3)); 2); tmpyr3:=@Text(@If(tmp3<1; tmpy-1; tmpy)); (tmpyr +"-" + tmpmo) : (tmpyr1 +"-" + tmpmo1) : (tmpyr2 +"-" + tmpmo2) : (tmpyr3 +"-" + tmpmo3) tmpy:=@Year(tmp);