I see. In that long discussion, there were 2 solutions in just one line (one formula) that don't depend on the SET DATE. This is why I asked. I thought you found some errors.
Vlad
>This may or may not be the best way. I saw a long discussion regarding _any_ way to get the last day of the month. Much of the code given was considerably longer and involved than the code I gave. So, although it does depend on the DATE being correct, assuming that, it works great.
>
>
>
>
>>Your function depends on the SET DATE setting.
>>
>>I'd like to know why is this the best way.
>>
>>Vlad
>>
>>>A thread a while ago was discussing the best way to find the last day of the current month. Since I couldn't find the messages I'll go ahead and answer the question here. The following code will find the last day of the month when passed a date parameter:
>>>
>>>Procedure LastDay
>>>LPARAMETERS dCurrent
>>>
>>>LOCAL lcValue, lcMonth, lcYear, ldValue, ldNewDate
>>>
>>>ldValue = GOMONTH(dCurrent,1)
>>>lcMonth = STR(MONTH(ldValue))
>>>lcYear = STR(YEAR(ldValue)
>>>lcValue = lcMonth+"/"+"01"+"/"+lcYear
>>>ldNewDate = CTOD(lcValue) - 1
>>>
>>>Return ldNewDate
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement