Function week works wrong since december 1998 
Author Message
 Function week works wrong since december 1998

Hi,

my Foxpro 5.0 app uses the function week(). Because week() did not
recognize the week containing the 31th of december as week 31, the
function is returning the wrong week since then.

Any ideas ?

Many thanks in advance.

Cheers, Bernd



Fri, 13 Jul 2001 03:00:00 GMT  
 Function week works wrong since december 1998
Hi,

you mean 53 instead of 31?
Use
week(dDate,2)
and see help why...


Quote:
>Hi,

>my Foxpro 5.0 app uses the function week(). Because week() did not
>recognize the week containing the 31th of december as week 31, the
>function is returning the wrong week since then.

>Any ideas ?

>Many thanks in advance.

>Cheers, Bernd



Fri, 13 Jul 2001 03:00:00 GMT  
 Function week works wrong since december 1998

Quote:

>my Foxpro 5.0 app uses the function week(). Because week() did not
>recognize the week containing the 31th of december as week 31, the
>function is returning the wrong week since then.

     Come again?

     There are 52 weeks and 1 day in a year.  *I* wouldn't recognize
December 31 as being in week 31 either.  Is "31" a two keys shifted
typo for "53"?

Quote:
>Any ideas ?

     Take a look at the week() function.

Quote:
>Many thanks in advance.

     You're welcome.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
     I have preferences.
     You have biases.
     He/She has prejudices.



Fri, 13 Jul 2001 03:00:00 GMT  
 Function week works wrong since december 1998
I'll bet he meant to say week #1 and he slipped on the shift key
Garry McMinds


Fri, 13 Jul 2001 03:00:00 GMT  
 Function week works wrong since december 1998
The 31 of December of what year?
There is a international ISO week numbering standard that stipulates :
1. Weeks start on Monday
2. All weeks have 7 days
3. Week 1 of any year is the first week with 4 days in the year.
nFirstDayofWeek = 2 && Monday
nFirstWeek = 2 && first with  4 days in year
This is implemented in FoxPro as WEEK(date, nFirstWeek, nFirstDayOfWeek)
WEEK({^1998-12-31}, 2,2) returns 53.
WEEK({^1999-12-31}, 2,2) returns 52.
See also SET FDOW and SET FWEEK

-Anders

Quote:

>Hi,

>my Foxpro 5.0 app uses the function week(). Because week() did not
>recognize the week containing the 31th of december as week 31, the
>function is returning the wrong week since then.

>Any ideas ?

>Many thanks in advance.

>Cheers, Bernd



Fri, 13 Jul 2001 03:00:00 GMT  
 Function week works wrong since december 1998
On Mon, 25 Jan 1999 22:10:40 +0100, "Anders Altberg"

Quote:

>The 31 of December of what year?
>There is a international ISO week numbering standard that stipulates :
>1. Weeks start on Monday
>2. All weeks have 7 days
>3. Week 1 of any year is the first week with 4 days in the year.
>nFirstDayofWeek = 2 && Monday
>nFirstWeek = 2 && first with  4 days in year
>This is implemented in FoxPro as WEEK(date, nFirstWeek, nFirstDayOfWeek)
>WEEK({^1998-12-31}, 2,2) returns 53.
>WEEK({^1999-12-31}, 2,2) returns 52.
>See also SET FDOW and SET FWEEK

>-Anders


>>Hi,

>>my Foxpro 5.0 app uses the function week(). Because week() did not
>>recognize the week containing the 31th of december as week 31, the
>>function is returning the wrong week since then.

>>Any ideas ?

>>Many thanks in advance.

>>Cheers, Bernd

Hi Anders,

thank you very much for your suggestion which solved the problem.

Cheers, Bernd



Sat, 14 Jul 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Foxpro Advisor October 1998

2. Foxpro Advisor October 1998

3. Date format to 12/1998

4. Week function

5. incorrect result with week function

6. Week : howto find the date of the first day of a week#

7. Week : howto find the date of the first day of a week#

8. Week : howto find the date of the first day of a week#

9. OBJNUM function with wrong result

10. OBJNUM function with wrong result

11. Edit buttons on form call to wrong work area

12. What's wrong with me - easy filter in 2.5 won't work

 

 
Powered by phpBB® Forum Software