I had not thought of that at all but yes, it sounds right.

Thank you very much

Rafael Copquin

----- Original Message ----- 
From: "Anthony J. Gundrum" <[email protected]>
To: <[email protected]>
Sent: Tuesday, September 15, 2009 6:45 PM
Subject: RE: date functions


> Well, if it's week 38 the it must be 38 * 7 days into the year.  So take 
> (38
> * 7) and add that to 1/1/year and you'll get the end date (38 * 7) days 
> into
> the year.  The seed date (1/1/year) is key.  You must define what is the
> first day of the week (Sat, Sun, Mon, something else) and determine what 
> the
> date is for that day of the week for the year you are working in.  Take 
> 2009
> for example.  1/1/2009 was a Thursday.  This is probably not your starting
> day of the week you are imagining.  I'll venture to guess that 1/1/2009
> (Thu) to 1/3/2009 (Sat) is week 1 for 2009 and 12/28 (Sun) to 12/31 (Wed) 
> is
> week 52 of 2008.  Does this sound right?
>
> John G.
>
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] 
> On
> Behalf Of Rafael Copquin
> Sent: Tuesday, September 15, 2009 19:24
> To: [email protected]
> Subject: Re: date functions
>
> 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/3982275ccb9042f382fbcf79bf39a...@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