Hye,
i m new in using VFP i want to know how can we calculate difference between
2 dates. suppose a person joining date is 25-09-2005 and he resigned at
25-12-2006. The period between 2 dates is 1Year 3Month. i use gomonth()
function but i am not able to get the difference in year and month.
Fred Taylor - 02 Nov 2006 16:36 GMT
In VFP it's easy to get the difference in days, just subtract the two date
type fields from each other. Once you have that number of days, you could
calculate the years/months etc, but's that's a lot more problematic as it is
entirely dependant on whatever your rules may be for what constitutes a
month.

Signature
Fred
Microsoft Visual FoxPro MVP
> Hye,
> i m new in using VFP i want to know how can we calculate difference
> between 2 dates. suppose a person joining date is 25-09-2005 and he
> resigned at 25-12-2006. The period between 2 dates is 1Year 3Month. i use
> gomonth() function but i am not able to get the difference in year and
> month.
Lee Mitchell - 03 Nov 2006 22:49 GMT
Hi Zeeshan Hussain:
Go to www.universalthread.com, click on the Downloads link, and choose
Visual FoxPro as the forum. In the ID text box of the query page, search
for "25738." The name of the download is "Age Calculator."
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/
*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr
Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
>Hye,
>i m new in using VFP i want to know how can we calculate difference between
>2 dates. suppose a person joining date is 25-09-2005 and he resigned at
>25-12-2006. The period between 2 dates is 1Year 3Month. i use gomonth()
>function but i am not able to get the difference in year and month.