Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to return the first day of a given week?
Message
De
11/09/1998 06:09:38
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
 
À
11/09/1998 03:56:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00135392
Message ID:
00135407
Vues:
6
>Hi all.
>The question says itself!
>
>Has anybody a solution?
>
>
>Best regards
>
>Per Simmersholm

Well, the question is open to interpretation. But, if the question means how can I find the first day of the week for a given week number in the year, then try this:

*-- Start
FUNCTION Day1
PARAMETERS lnWeek
LOCAL lnThisWeek, ldTodayInWeek, ldFirstDayInWeek

lcThisWeek = WEEK( DATE())

ldTodayInWeek = DATE() - ((lcThisWeek - lnWeek) * 7)

*-- Now to get first day of week
ldFirstDayInWeek = ldTodayInWeek - ( DOW( ldTodayInWeek) - SET("FDOW"))

RETURN ldFirstDayInWeek
*-- End

Which will work with the current settings of FWEEK and FDOW
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform