Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Last day of month
Message
De
21/08/2008 14:13:28
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Vista
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01340781
Message ID:
01340883
Vues:
10
>thanks Naomi. I was hoping that there was a built in FP one, ended up doing this
>
>CTOD("01/" + IIF((MONTH(mx) + 1)>12,'01',ALLTRIM(STR((MONTH(mx) + 1)))) + "/" + ALLTRIM(STR(YEAR(mx)))) - 1
>
>but some of the functions in the FAQ look neater :)
>~M
>>>hi,
>>>is there a routine that returns the last day of the month? something like lastdayofmonth(date()) giving me 31 for the month of august etc. I could write a routine but thought i saw one before but cannot find it.
>>>~M
>>
>>GoMonth(date(MyYear, MyMonth,1),1) -1
>>
>>See also Some useful date functions FAQ #7661

Hi Mark

You seem to be looking to make your code more readable. I think you'll agree FirstDayOfMonth(date()) is better than even a simple formula like this: date() - DAY(Date()) + 1. So get FirstDayOfMonth.prg and LastDayOfMonth.Prg from here:

http://fox.wikis.com/wc.dll?Wiki~FirstDayOfMonth

http://fox.wikis.com/wc.dll?Wiki~LastDayOfMonth

HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform