Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining the End of the Month
Message
From
18/03/1999 09:36:39
 
 
To
18/03/1999 01:26:22
Fida Shamsoodeen
Combined Systems (Pty) Ltd
Centurion, South Africa
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00199069
Message ID:
00199171
Views:
22
>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
Map
View

Click here to load this message in the networking platform