Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compute how many years,months,days
Message
From
28/10/2004 06:49:20
 
 
To
28/10/2004 06:37:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 5
Miscellaneous
Thread ID:
00955191
Message ID:
00955201
Views:
18
You should get 41 5 27
I' just tried copying and pasting the code...
but which version of VFP are you using ? check if it supports the function gomonth().


>hi,
>thank you for reply,
>i'll try as under
>i get result 0 0 0
>
> a = CTOD("29/03/1963")
> b = CTOD("25/09/2004")
>
>
>NumYear = Year(b)-Year(a)
>NumMonth = Month(b)-Month(a)
>NumDay = Day(b) - Day(a)
>
>If NumDay < 0
>NumMonth = NumMonth - 1
>Numday = (Gomonth(a,1)-Day(Gomonth(a,1)) - a )+ Day(b)
>EndIf
>If NumMonth < 0
>NmYear = NumYear - 1
>NumMonthi = Abs(NumMonth)
>EndIf
>
>? NumYear, NumMonth, NumDay
>
>
>best regards.
>m.qasem
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform