greg,
The code depends on SET DATE AMERICAN to be in effect. It'll produce incorrect resut or blow up with other settings. It's better to use DATE() function. Also YEAR() function requires an argument.
RETURN DAY(GOMONTH(DATE(pnYear, pnMonth,1),1) -1)
>An error in the formula - it should be:
>
>
>FUNCTION DayInMonth
>LPARAMETERS pnMonth
>RETURN DAY(GOMONTH(CTOD(TRANSFORM(pnMonth)+"/01/"+TRANSFORM(YEAR())),1)-1)
>
>
>Should use CTOD() rather than DTOC()...
--sb--