Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number of days in a month
Message
De
11/10/1997 07:57:38
 
 
À
09/10/1997 19:38:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00053634
Message ID:
00054153
Vues:
40
>>>Is there a function to get the number of days in a month.
>>>eg. the number of days in any month of any year.
>>>
>>>Thanks
>>>Andrew
>>
>>Sometime ago I wrote a 10 line function to simply determine the last day of the current month. I kept adding days until the date function determined the data was invalid. Something like this:
>>...
>>For I = 1 to 31
>> lcChkDate=Month...+"/"+STR(I,2)+"/"+Year...
>> ...
>> IF DATE(lcChkDate)=" / / "
>> * Invalid Date take Previous I (Day) (I-1)
>> * as last Day of Current Month
>>
>> * Define variable here ldDate=DATE(lcChkDate)
>> EXIT
>> ENDIF
>>Endfor
>
>You may wanna take a look to one my FAQs in the KB. It can be done with a simple one line formula.
>
>Vlad
Why don't you use
day(gomonth(xdate ,1) - day(gomonth(xdate ,1))) && xdate is a date value
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform