Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding month and days
Message
De
21/08/2006 15:50:48
 
 
À
21/08/2006 15:39:43
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:
01147406
Vues:
20
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform