General information
Category:
Coding, syntax & commands
Thanks. Jim Booth already pointed out that my formula was wrong. I fixed now... :))
Vlad
>Try that with, say 97/03/01, or May, or July, or...I don't think it works.
>
>You are assuming that the previous month has as many days as the current month.
>
>Try two steps:
>
>lcDate = GoMonth(ldMyDate,1)
>lcDate = lcDate - day(lcDate)
>
>This way you are taking advantage of the fact that the FoxPro gomonth() function takes care of the problems with 'uneven' months. For example, gomonth({97/08/31}, 1) gives you {97/09/30}, and you then work with 30 (not 31) for your subtraction.
>
>Take care,
>Joe
>
>
>>>>The easiest way I know:
>>>>
>>>>lcDate=GoMonth(ldMyDate-day(ldMyDate),1)
>>>>
>>>>This doesn't depend on SET CENTURY or SET DATE, it works for leap years, etc.
>>>
>>>Thanks a lot. It does the job perfectly.
>>
>>Perfectly and excatly! :)
>>
>>You're welcome.
>>
>>Vlad
Previous
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