I figured it out. It should read for January:
 Code:
$thismo = @monthno -2
IF $thismo = -1
  $month = "11" ;; to run for november
ELSE
  IF $thismo > 9
    $month = CSTR($thismo)
  ELSE
    $month = "0" + CSTR($thismo)
  ENDIF
ENDIF
$year = IIf(@MONTHNO = 1, @YEAR -1, @YEAR) ;; to run in january


and next month it will read:
 Code:
$thismo = @monthno -2
IF $thismo = 0
  $month = "12" ;; to run for december
ELSE
  IF $thismo > 9
    $month = CSTR($thismo)
  ELSE
    $month = "0" + CSTR($thismo)
  ENDIF
ENDIF
$year = IIf(@MONTHNO = 2, @YEAR -1, @YEAR) ;; to run in February