Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Days in month
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8
Divers
Thread ID:
01266644
Message ID:
01266674
Vues:
9
>>Try with ldDate = {^2007/1/31}
>>
>>>Get the LastDay of this month:
>>>
>>>? GetLastDay({09/09/2006})
>>>
>>>
>>>FUNCTION GetLastDay(ldDate)
>>>RETURN DAY(GOMONTH(ldDate,1)-DAY(ldDate))
>>>
>
>Why I always forget February?
>
>? GetLastDay(DATE(2007,1,31))
>
>FUNCTION GetLastDay(ldDate)
>LOCAL ldDate1
>ldDate1 = GOMONTH(ldDate,1)
>RETURN DAY(ldDate1-DAY(ldDate1))
>
The problem with your previous code was not only with February but any month that precedes another month with less days and date is the last day of the month. Eg ldDate = {^2007/3/31} would return 30 instead of 31.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform