Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange result using Week()
Message
 
 
À
24/08/2005 10:54:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01043193
Message ID:
01043456
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.

>All wrong.
>
>Then who has not understood anything:
>those of the VFPT or those of the SQLTeam?
>
>Run next code on MSSQL;
>week 1 have 1 day only !
>
>declare @tt table (dd datetime)
>declare @i int
>select @i=1
>while @i<20
>begin
> insert into @tt values(cast('20041225' as datetime)+@i)
> select @i=@i+1
>end
>select dd,datename(ww,dd) from @tt
>
>
>Run this on VFP;
>The last week of 2004 is week 1!
>
>CLEAR
>dd={^2004/12/24}
>FOR d=1 TO 20
>  ? dd+d,WEEK(dd+d)
>NEXT
>
>
>It is evident that it is wrong VFP,
>because if it is defined that a week Has to have 7 days,
>then, the week can race on more years and then the week numeration has to be a sequence:
>... 1,..... 53,54,.... 678,... 45666....
>
>After all, the formal correctness of MSSQL is not absolute,
>but it is not comparable with that of VFP (it doesn't have any global formal correctness)
>
>Now, solve these problems:
>1. GROUP BY WEEK( ) within a Year.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform