>>>? GetLastDay({09/09/2006}) >>> >>> >>>FUNCTION GetLastDay(ldDate) >>>RETURN DAY(GOMONTH(ldDate,1)-DAY(ldDate)) >>>>
>? GetLastDay(DATE(2007,1,31)) > >FUNCTION GetLastDay(ldDate) >LOCAL ldDate1 >ldDate1 = GOMONTH(ldDate,1) >RETURN DAY(ldDate1-DAY(ldDate1)) >The problem with your previous code was not only with February but any month that precedes another month with less days and date is the last day of the month. Eg ldDate = {^2007/3/31} would return 30 instead of 31.