if (HasValue(retireDate1)) then
var retireDate1_ = Date2Num(retireDate1.formattedValue, "MM/DD/YYYY")
retireDate1_ = retireDate1_ + 1
while (Substr(Num2Date(retireDate1_,"MM/DD/YYYY"),4,2 ne "01") do
retireDate1_ = retireDate1_ + 1
endwhile
$ = Num2Date(retireDate1_, "MM/DD/YYYY")
endif
See if that works for you.