hello friends
if you are looking the code for calculating time interval such as Age, then you can use the following function.
[code title=”use DateDiff function”] Private Function CalculateAgeString(ByVal StartDate As DateTime, _
ByVal EndDate As DateTime) As String
Dim dt As Long = DateDiff(DateInterval.Month, StartDate, EndDate)
Dim years As Integer = dt \ 12
Dim months As Integer = dt Mod 12
Dim strAge As String = “”
If months = 0 Then
strAge = years & ” years”
Else
strAge = years & ” years” & ” ” & months & ” month”
End If
Return strAge
End Function
[/code]
Try this and let me know