Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Answer: Best Way to Find Last Day of Month
Message
De
28/07/1997 18:42:29
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00041995
Message ID:
00042026
Vues:
45
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
Fil
Voir

Click here to load this message in the networking platform