Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Last day of a month
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00287143
Message ID:
00287164
Views:
24
>>Hello everyone.
>>
>>Is there a native VFP function to return the last day of the month?
>>
>>Thanks,
>>Sergio
>
>No, but there's a combination:
>
>GOMONTH(DATE()- DAY(DATE() + 1), 1) - 1
>
>I know that's convoluted, but it's the only reliable way. DATE() - DAY(DATE()) gives you the last day of the previous month. Add a day to give you the first of the current month. GOMONTH() gives you the first of the next month. -1 gives you the last day of the current month.

How about GOMONTH( DATE(),1 ) - DAY( GOMONTH( DATE(),1 ) )
I guess there's many ways to skin a cat.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform