Hello Everyone: I am having trouble converting an animal's age, such as the result of a calculation as 1.3 , to 1 year 4 months.
Can anyone tell me how to do this?
This is the function that was given to me by DHookum, a long time ago:
Public Function GetEstAge(strInterval As Variant, _
intAgeEst As Variant, ArrDate As Variant _
) As Variant
If Not (IsNull(strInterval) Or IsNull(intAgeEst)) Then
Select Case strInterval
Case "week(s)"
strInterval = "ww"
Case "month(s)"
strInterval = "m"
Case "year(s)"
strInterval = "yyyy"
End Select
'
GetEstAge = Format(((Date - DateAdd(strInterval, -intAgeEst, ArrDate)) / 365.25), "0.0")
Else
GetEstAge = Null
End If
End Function
Thank you, Sophia
Can anyone tell me how to do this?
This is the function that was given to me by DHookum, a long time ago:
Public Function GetEstAge(strInterval As Variant, _
intAgeEst As Variant, ArrDate As Variant _
) As Variant
If Not (IsNull(strInterval) Or IsNull(intAgeEst)) Then
Select Case strInterval
Case "week(s)"
strInterval = "ww"
Case "month(s)"
strInterval = "m"
Case "year(s)"
strInterval = "yyyy"
End Select
'
GetEstAge = Format(((Date - DateAdd(strInterval, -intAgeEst, ArrDate)) / 365.25), "0.0")
Else
GetEstAge = Null
End If
End Function
Thank you, Sophia