Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date of week function?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01671464
Message ID:
01671468
Vues:
93
This message has been marked as the solution to the initial question of the thread.
>>>Hi,
>>>
>>>VFP 9 has a nice function Week() (determines week by the date). I cannot find in Help and maybe I am missing it, if there is a revers function, to determine date defining the week by the week number? For example, if the Week() is used as follows:
>>>
>>>nWeek = Week( date(), 3, 2 )   && where 2 defines that the week must have Monday    
>>>
>>>Then I would use the reverse function as:
>>>
>>>dMonday = WDate( nWeek, 3, 2 )
>>>
>>>
>>>Of course, I could write such a function (WDate()) but it VFP has it, why not use it.
>>>
>>>TIA
>>
>>No, there AFAIK is no such native function.
>
>Thank you.
This will only return todays date unless you specify which day-of-the-week you want the date for. 41 is the week number.
DATE(YEAR(DATE()),1,1)+(7-DOW(DATE(YEAR(DATE()),1,1)))-6+(41*7)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform