Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number of Weeks
Message
De
16/11/1999 23:48:12
 
 
À
15/11/1999 13:24:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00290989
Message ID:
00291781
Vues:
44
Sorry Dore, my thinking cap was in the shape of a cone.

Try this:
INT((date1-date2)/7)
Be certain to make date1 the latter date. This formula should work with spanning years.

Tom Mooloy

>>>>>Can anyone think of a formula or fast piece of code (I plan on running it from a SELECT) that can tell me the number of weeks since 11/1/99? I'm thinking some combination of the year and WEEK() might do it, but I haven't come up with anything.
>>>>>
>>>>>Thanks,
>>>>>
>>>>>Michelle
>>>>
>>>>It would be the difference of the weeks...
>>>>
>>>>Week( MyDate ) - Week( {^1999.11.1} )
>>>>
>>>>BOb
>>>That works within the year. Between 1/1/2000 and 11/1/2000 (or thereabout) your expression would return a negative number.
>>If you use an absolute function, the number returned will always be a positive value.
>>
>>Tom Molloy
>I don't understand.
>WEEK({^1999-11-01}) = 45
>WEEK({^2000-01-01}) = 1
>ABS(1 - 45) = 44
>There are only 8 weeks between 11/1/1999 and 1/1/2000.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform