Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return the first day of a given week?
Message
From
11/09/1998 06:09:38
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
11/09/1998 03:56:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00135392
Message ID:
00135407
Views:
7
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform