Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange result using Week()
Message
De
24/08/2005 16:48:30
 
 
À
24/08/2005 15:50:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01043193
Message ID:
01043589
Vues:
7
>>They both wrong and both right because they use there own definition of the WEEK(). See http://www.windowsitpro.com/SQLServer/Article/ArticleID/14340/14340.html, for example.
>>
>
>I don't agree.

You may not agree, but a standard is a standard, and the international standard is that week 1 is the first week of the year to contain at least four days. But nobody can push a standard on you, so if you want to set your own standard, so to say, be my guest. I know that not all countries follow this standard, that's one of the reasons why VFP gives you the additional parameteres to the WEEK() function.

As I see it, there is no right or wrong here, the question is whether you want to follow the international standard or not.


>MSSQL is not wrong.
>The implementation of MSSQL is correct.
>It is:
>
>- First week contains January 1st. ( Only this !)
>- and return expected values:
>- 2004-01-01 00:00:00.000   1
>- 2004-12-31 00:00:00.000  53
>
>
>This definition allow the week grouping.
>It don't support ISO 8601,
>no problem, the Team can add a datepart tag like w8601.
>
>On VFP and VB.NET is supported four definitions.
>We consider that of default on VFP,
>it is the same one of MSSQL and VB.NET (FirstWeekOfYear.Jan1):
>
>- First week contains January 1st.
>- and return wrong values
>- 2004-01-01   1
>- 2004-12-31   1
>
>VFP apply the ISO 8601 rule ( a week have 7 days )
>to the "First week contains January 1st",
>and this is incorrect.
>
>This is a bug or a bad design,
>and it makes incompatible VFP with MSSQL
>and very difficult every week grouping in a VFP's sql query.
>
>Don't implement something it is not an error, to wrongly do it it is doubly wrong
>because is simple add a new behaviour
>but to change one wrong creates many problems.
>
>Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform