Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Days from the year beginning to dd/mm
Message
De
07/08/2007 05:39:44
 
 
À
07/08/2007 05:26:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01246410
Message ID:
01246417
Vues:
29
To be pedantic it should be
? DATE(lnYear-1, 12, 31 ) + lnNumberOfDaysFromTheBeginning
what puzzles me now Foxpro does reasonably complicated operator overloading as above , but doesn't like
"1" + 1
which is implicitly converted to string "11" in mainstream languages now.

>Thanks.
>That's what I wanted
>? DATE(lnYear, 1, 1)+lnNumberOfDaysFromTheBegiining
>
>
>>>Is there function in VFP or in contributions which for given number of days from the year beginning will return month or day of month it falls on or just a {date}.
>>>
>>>
>>>
>>>TIA
>>>Michael
>>
>>I am not so sure what you asking for, but try this:
>>
>>? DaysFromStart(123, 2005)
>>? DaysFromStart(123)
>>? DaysFromStart(123, 2008)
>>
>>FUNCTION DaysFromStart(lnNumberOfDays, lnYear)
>>
>>IF VARTYPE(lnYear) # [N]
>>   lnYear = YEAR(DATE())
>>ENDIF
>>IF VARTYPE(lnNumberOfDays) # [N]
>>   MessageBox([And what you want :-)?])
>>ENDIF
>>
>>RETURN DATE(lnYear, 1, 1)+lnNumberOfDays
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform