Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange result using Week()
Message
De
24/08/2005 15:50:45
 
 
À
24/08/2005 12:47:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01043193
Message ID:
01043569
Vues:
9
>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.

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