How to determine the difference between two dates? 
Author Message
 How to determine the difference between two dates?

Is there a function in Microsoft FoxPro 5.0 that will allow me determine
the difference in years between two given dates.  If so, what is the
name of this function?  If not, how can I go about doing this?  It can
be easily done in Visual Basic with the DateDiff function.  Any
suggestions or help would be greatly appreciated.

Matt Ricciardi



Tue, 16 Nov 1999 03:00:00 GMT  
 How to determine the difference between two dates?

You can subtract two dates and get the difference in days. You can
then divide by 365 - that does everything but take into account leap
years.

Are you looking for someone's age or what?

On Fri, 30 May 1997 16:55:40 -0400, "Matthew J. Ricciardi"

Quote:

>Is there a function in Microsoft FoxPro 5.0 that will allow me determine
>the difference in years between two given dates.  If so, what is the
>name of this function?  If not, how can I go about doing this?  It can
>be easily done in Visual Basic with the DateDiff function.  Any
>suggestions or help would be greatly appreciated.

>Matt Ricciardi




Wed, 17 Nov 1999 03:00:00 GMT  
 How to determine the difference between two dates?

Use date arithmetic:

Date1 = DATE()
Date2 = {5/30/1997}
? Date1 - Date2

answer is 1 (today anyway).

--
Richard Seymour, Anarchy Software, Inc.

http://www.wavetech.net/~anarchy



Quote:
> Is there a function in Microsoft FoxPro 5.0 that will allow me determine
> the difference in years between two given dates.  If so, what is the
> name of this function?  If not, how can I go about doing this?  It can
> be easily done in Visual Basic with the DateDiff function.  Any
> suggestions or help would be greatly appreciated.

> Matt Ricciardi




Wed, 17 Nov 1999 03:00:00 GMT  
 How to determine the difference between two dates?

If you have two dates, A and B, you can subtract them to get the number of
days elasped.  C = B - A.
From here you can get the number of years by dividing by 365
D = C / 365
Continue this logic to get any date difference information you require.



Wed, 17 Nov 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Way to figure out number of months difference between two dates

2. Difference between two tables

3. How to extract the difference data records from two similar tables

4. date difference

5. Date Time differences?

6. Date differences between VFP 5 and VFP 6

7. date time type differences between vfp5 and vfp6

8. Date Difference function

9. Date Difference

10. Determining # of months between arbitrarry dates

11. How to figure Average of days between two dates for a group

12. Midpoint between two dates

 

 
Powered by phpBB® Forum Software