Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dates by Number of Week
Message
De
19/11/2001 11:20:07
 
 
À
19/11/2001 11:04:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00583459
Message ID:
00583499
Vues:
26
This message has been marked as a message which has helped to the initial question of the thread.
>>Hi everybody,
>>
>>Given 52 weeks in a year and week definition (from Sat through Friday) I need to calculate Week's first day, week's last day and some other dates for the given year for each week. What would be a formula here?
>>
>>Thanks a lot in advance.
>

This may be closer to actual function you want:
procedure getFirstDateofWeek
lparameters lnYear, lnWeek
    lnFirstDOW = 7   && Saturday

    lnFirstDate = date(lnYear, 1, 1) + (lnFirstDOW - dow(date(lnYear, 1, 1)))
    return lnFirstDate + (lnWeek - 1)*7
endproc
Steve Gibson
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform