Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date occurance for specific day of the week per month.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00187864
Message ID:
00187889
Vues:
17
>The following formula gives you the following day of week after (including) the ldDate date:
>
>ldDate + mod(lnDay - dow(ldDate, 1), 7)
>
>where lnDay = 1 (Sunday), = 2 (Monday), etc.
>
>If you want the 3rd Thursday of the month, call it with ldDate = the first day of the month and lnDay = 5 and add 14:
>
>ldDate + mod(lnDay - dow(ldDate, 1), 7) + 14
>
>To get the first day of the month when you have the month and the year:
>
>ld1stDay = ctod("^" + str(lnYear, 4) + "/" + str(lnMonth, 2) + "/01")
>
>Vlad
>
>>For example, how would I calculate the dates for every third Thursday of the month for the next six months and store those dates in an array for later processing.
>>
>>If anyone has done this type of calculation and is willing to share with me the solution, I would greatly appreciate it. Hate to reinvent the wheel.
>>
>>TIA,
>>
>>James Moore


Thanks, Vlad for this excellent solution and for responding so quickly!

James
James Moore
Owner/Developer
Ministry Tracking Software, Inc.
www.youthtrack.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform