Yep, DateAdd was new in CR 8
Try this one then: (you can get rid of the stuff in BOLD BLUE if you won't be calcating a date before 1901 and after 2099 otherwise the special leap year rules apply
Numbervar mnth:=month({your.date.field});
numbervar yr:=year({your.date.field}
numbervar dayout;
=====================
if mnth in [1,3,5,7,8,10,12] then dayout:=31 else
if mnth in [4,6,9,11] then dayout:=30 else
if remainder(yr,400)=0 then dayout:=29 else
if remainder(yr,100)=0 then dayout:=28 else
if remainder (year,4)=0 then dayout:=29 else
dayout:=28;
date(yr,mnth,dayout)
=====================
Mike