Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Week by Month
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01180294
Message ID:
01180320
Vues:
20
>>
>>FUNCTION FourthFridayOfMonth(tnYear, tnMonth)
>>LOCAL lnDOW
>>lnDOW = DOW(DATE(tnYear, tnMonth, 01), 7)
>>RETURN DATE(tnYear, tnMonth, 7 - lnDow + 1 + 3*7)
>>
>>* or one-liner
>>FUNCTION FourthFridayOfMonth(tnYear, tnMonth)
>>RETURN DATE(tnYear, tnMonth, 7 - DOW(DATE(tnYear, tnMonth, 01), 7) + 1 + 3*7)
>>
>>
>>
>
>Sergey,
>
>Just curious, why do you use DATE(tnYear, tnMonth, 01), 7) to get Saturday, not Friday?

The DOW(,7) returns Friday as the last day of the week (7) which makes consequent calculations simpler.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform