General information
Category:
Coding, syntax & commands
>>>>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.
>
>Absolutely, in FoxPro there's about 3 ways to skin any cat.
>
>SET ANAL RETENTION ON
>
>However, in my own informal time trials, my solution runs about a 10th of a second quicker in 500000 repetitions.
>
>SET ANAL RETENTION OFF
>
>NBD. :}
Hey, if Jim Booth is using the same solution, it must be right. :p
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