Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange result using Week()
Message
De
24/08/2005 04:22:38
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01043193
Message ID:
01043201
Vues:
10
>Hi.
>1. Week(^{2005/01/01},3,2) Returns 52
>2. Week(^{2005/01/02},3,2) Returns 52
>3. Week(^{2005/01/03},3,2) Returns 1
>
>Surely 1 & 2 above are returning an incorrect week no.
>The second parameter indicates Seven Days, the third to start on a Monday
>
>Its probably because it considers it as Week 52 of last year (?) but the fact that I have 2005 in the year , should'nt this return a zero ?

I Agree, VFP is incorrect here, zero it is the correct choice.
Example:
SELECT ... GROUP BY WEEK() && this merge 1/1 with 31/12
>(.i.e the 1st and 2nd of Jan 2005 dont belong to any week IN 2005 if Monday 3rd is the first day of the year)
>
>Regards,
>
>Gerard
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform