SteveL13
asked on
Round date difference to nearest single decimal
I have this formula:
Me.txtCurrentLifeOfAsset = Int(([txtDateInventoryPerf ormed] - [txtDateofPurchase]) / 365.25)
Which calculates the difference between two dates in whole years. For example 6/1/2014 - 3/1/2009 is giving me 5.0 years. But I want it to show the decimal. In other words 5.2
What do I have to change in the formula to make this possible?
Me.txtCurrentLifeOfAsset = Int(([txtDateInventoryPerf
Which calculates the difference between two dates in whole years. For example 6/1/2014 - 3/1/2009 is giving me 5.0 years. But I want it to show the decimal. In other words 5.2
What do I have to change in the formula to make this possible?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
DecimalYears = CDbl(Format(DateDiff("d", datFrom, datTo) / 365, "0.0"))
/gustav