Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calculate Difference Between 2 Dates

1,732 views
Skip to first unread message

Zeeshan Hussain

unread,
Nov 2, 2006, 5:59:34 AM11/2/06
to
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

unread,
Nov 2, 2006, 10:36:33 AM11/2/06
to
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.

--
Fred
Microsoft Visual FoxPro MVP


"Zeeshan Hussain" <zee...@crescentsugar.com> wrote in message
news:eflnw3m$GHA....@TK2MSFTNGP03.phx.gbl...

Lee Mitchell

unread,
Nov 3, 2006, 4:49:18 PM11/3/06
to
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

0 new messages