i'm creating assets tracking data base, i have to set asset depreciation every year of asset life, i am using datediff() but it count total duration of asset, i want that starting date and ending date and computer count integer number until the ending date for example purchased asset date 12-Aug-2010 useful life of Asset is 12-Aug-2014, between both dates computer account automatically number that has been passed ..
count year to year between two dates
Collapse
X
-
Tags: None
-
irfanEmmaneul,
Try a public function similar to this:
Code:Public Function WhatIsAge(AssetDate As Date) As String Dim intYears As Integer Dim intMonths As Integer Dim intDays As Integer intYears = Format(Date - AssetDate, "yy") intMonths = Month(Date - AssetDate) - 1 intDays = Day(Date - AssetDate) WhatIsAge = "Asset is " & _ intYears & " years, " & _ intMonths & " months, " & _ intDays & " days old." End Function
Comment