Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Month Calculations
Message
De
24/04/2001 08:17:34
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
24/04/2001 08:10:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00498208
Message ID:
00498941
Vues:
18
>With respect - I included the days. Unfortunately, the days bit 'fell off' the submission (HTML tags or something) I repeat it below:
>
>Monthdiff = 12*(year(t1)-year(t2)-1) + month(t1)-month(t2) ;
>- iif(day(t1) < day(t2), 1, 0)
>
>In other words, calculate the months, and reduce the result by one if the day of the second date is less than the day of the first result.
>
>Regards
>
>Mike

Mike,
I didn't comment on yours separately but it's caught too. -1 there seems to be a typo ( consider {^2000/1/1} and {^2001/1/1} ). Other than that yours would work almost with the exception of leap years ( {^2000/02/29} and {^2001/02/28}).
Regards.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform