Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a function that returns the number of days in a
Message
De
10/11/2000 12:48:37
 
 
À
10/11/2000 12:31:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00440276
Message ID:
00440296
Vues:
17
>>>Is there a function that returns the number of days in a month?
>>>example...
>>>jan has 31 days
>>>days_in_a_month = (some_function,jan)
>>>?days_in_a_month
>>>31....any ideas?
>>
>>Nope but try
>>
>>** gets number of days in given month
>>ldDate = DATE() && or whatever
>>ldFirst = DATE(YEAR(ldDate), MONTH(ldDate), 1)
>>lnDaysInMonth = GOMONTH(ldFirst,1)-ldFirst

>
>Actually, you don't need the first 2 lines,
>IOW
>
>lnDaysInMonth = GOMONTH(ldDate,1)-ldDate

ARGGH!!! --- not you, me :-(

Yes you do need the first 2 lines, or at least the functionality, e.g.
ldDate = Some_Date
lnDaysInMonth = GOMONTH(DATE(YEAR(ldDate), MONTH(ldDate), 1),1) - DATE(YEAR(ldDate), MONTH(ldDate), 1)


Certain dates don't work the other way, where the dates are higher than the date in the next month like the 31st of a month where the next month has 30 days.
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform