Thank you but that is not what I need.

If I know I am on week 38 of the year, how do I determine the date ranges of 
that week?

I guess I'll just have to write my own function

Rafael


----- Original Message ----- 
From: "MB Software Solutions General Account" 
<[email protected]>
To: <[email protected]>
Sent: Tuesday, September 15, 2009 5:12 PM
Subject: Re: date functions


> [email protected] wrote:
>> Given a week number, what function should I use to determine the range
> of dates of that particular week?
>>
>> Example:  today is Sep 15th, 2009
>>
>> week( date()) = 38
>>
>> Now, if I know the week number (week 38), how can I tell the first and
> last days of that week?
>>
>> Is there a specific function in VFP or should I build my own?
>
>
> Ed Leafe had some common functions to provide this kind of stuff.
> Here's what I have from long ago:
>
> FUNCTION FirstDayOfMonth(tdDate as Date) as Date
>
> if PARAMETERS()=0 then
> tdDate = date()
> endif
>
> return (tdDate - (DAY(tdDate)-1))
> ENDFUNC && FirstDayOfMonth
>
>
> FUNCTION LastDayOfMonth(tdDate as Date) as Date
>
> if PARAMETERS()=0 then
> tdDate = date()
> endif
>
> return (GOMONTH(tdDate,1) - DAY(GOMONTH(tdDate,1)))
> ENDFUNC && LastDayOfMonth
>
>
> FUNCTION FirstDayOfWeek(tdDate as Date) as Date
>
> if PARAMETERS()=0 then
> tdDate = date()
> endif
>
> return (tdDate - (DOW(tdDate)-1))
> ENDFUNC && FirstDayOfWeek
>
>
> FUNCTION LastDayOfWeek(tdDate as Date) as Date
>
> if PARAMETERS()=0 then
> tdDate = date()
> endif
>
> return (tdDate + (7 - DOW(tdDate)))
> ENDFUNC && LastDayOfWeek
>
>
> FUNCTION LastMonthDate(tdDate as Date) as Date
>
> if PARAMETERS()=0 then
> tdDate = date()
> endif
>
> return (GOMONTH(tdDate,-1))
> ENDFUNC && LastDayOfWeek
>
>
> FUNCTION NextMonthDate(tdDate as Date) as Date
>
> if PARAMETERS()=0 then
> tdDate = date()
> endif
>
> return (GOMONTH(tdDate,1))
> ENDFUNC && LastDayOfWeek
>
>
> FUNCTION JulianDate(tdDate as Date) as Date
>
> if PARAMETERS()=0 then
> tdDate = date()
> endif
>
> return (tdDate - DATE(YEAR(tdDate)-1, 12, 31))
> ENDFUNC && JulianDate
>
>
> -- 
> Mike Babcock, MCP
> MB Software Solutions, LLC
> President, Chief Software Architect
> http://mbsoftwaresolutions.com
> http://fabmate.com
> http://twitter.com/mbabcock16
>
>
>
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/55ec52ede5b74c19a663d3408eb7b...@rafael
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to