>We need to determine exactly how many months difference there is between 2 dates in VFP
>Example:
>01/01/2001 - 03/01/2001 = 3 months
>
>We are currently trying the following:
>x=date1 (01/01/2001)
>y=date2 (03/01/2001)
>z=y - x
>b=z/365*12
>c=b +1
>
>result=int(c)
>
>The problem we are running into is short months
>
>
>Larry
Try this,
((year({^2001/03/01}) - year({^2001/01/01})) * 12) + (month({^2001/03/01}) - month({^2001/01/01}))
or (year(datehi) - year(datelo) * 12) + (month(datehi) - month(datelo)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only