Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding month and days
Message
De
21/08/2006 16:33:05
 
 
À
21/08/2006 16:19:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01147383
Message ID:
01147416
Vues:
22
>>>>>Hello Experts!
>>>>>
>>>>>I want to find the number of days and month from from a range of date. Here is my problem:
>>>>>
>>>>>I have two date(british date);
>>>>>
>>>>>date1="12/12/2005" and date2=21/08/2006
>>>>>
>>>>>Thriugh mathematics I know the difference is ;
>>>>>
>>>>>8 months and 10 days.
>>>>>
>>>>>How I can proceed with VFP to get the result?
>>>>>
>>>>>Chandan
>>>>
>>>>10 days ? sure ?
>>>>
>>>>
>>>>SET DATE DMY
>>>>date1=CAST("12/12/2005" as d)
>>>>*
>>>>date2=CAST("21/08/2006" as d)
>>>>
>>>>mdiff =((YEAR(date2)-YEAR(date1))*12+MONTH(date2)-MONTH(date1)) % 12
>>>>dDiff = date2 - GOMONTH(date1,mdiff)
>>>>CLEAR
>>>>
>>>>? mdiff,dDiff
>>>>
>>>PMFJI, Fabio
>>> but I think it depends on if you just want the difference between the two days, such as your example, or if you need the number of days for that period for finanical purposes, which causes one day to be added to the difference because you have to include the begin and end days of the period. Hope this makes since.
>>>
>>>Beth
>>
>>sorry but this is a common financial error.
>>
>>
>>* put money in the "12/12/2005" day
>>* get money in the "13/12/2005" day
>>* financial days are 1 for me not 2
>>
>>
>>otherwise
>>
>>* put 1M$ money in the "12/12/2005" day ( at 8.01 )
>>* get 1M$ money in the "12/12/2005" day ( at 8.02 ) with 1 day of interest
>>* repeat the operation at 8.03,8.05 ....
>>* to the evening you are richer
>>
>yes, that is true, maybe I said this wrong.
>go on business trip - 12/12/2005
>get back from trip - 13/12/2005
>Financial days are 2 not 1 for me.
>

I now understand because the Americans have many $
>Hope that makes better since.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform