>Can anyone please tell me if you have created a class or
>a function that can return the End of the month date, including
>determining the leap year..
>
>Thanks
>Fida Shamsoodeen
Hi Fida, try this.
****************************************************
* This function returns the last day of the month.
* If Passed a value for mthno, returns the last day
* of the month, n months from the date sent.
* IF nodate passed, returns the current month-end date.
*****************************************************
PARAMETER datesent, mthno
datesent =IIF(TYPE('datesent') <>"D", DATE(), datesent)
mthno = IIF(TYPE('mthno') <>'N', 0, INT(mthno))
IF mthno <> 0
datesent =GOMONTH(datesent, mthno)
ENDIF
** Return last day of the month
RETURN (GOMONTH(CTOD(ALLTRIM(STR(MONTH(datesent)))+ ;
"/01/"+RIGHT(ALLTRIM(STR(YEAR(datesent))),2)), 1) -1)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only