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:
00287167
Views:
19
>>>Hello everyone.
>>>
>>>Is there a native VFP function to return the last day of the month?
>>>
>>>Thanks,
>>>Sergio
>>
>>Not that I know of, but you can use the DATE() function. For example, if you wanted to know the last day of the current month, you could do something like this:
>>
>>DATE(YEAR(DATE()), MONTH(GOMONTH(DATE(), 1)), 1) - 1
>>
>>hth
>
>That won't work for dates in December because it will give you 31-Dec-1998.
>
>You could add the following:
>
>DATE(YEAR(DATE()) + IIF(MONTH(DATE()) < 12, 0,1) , MONTH(GOMONTH(DATE(), 1)), 1) - 1
>
>to it. Or you could use my method. (See Message)

Good point. I better go check my code 8-(

After further review, I already had it using your method. Funny.. 8-)

Doug Stalter

"According to the proverb, the best things are the most difficult." -Plutarch
Previous
Reply
Map
View

Click here to load this message in the networking platform