i have my code which runs fine, but i want to use my expression if any or can i do in my expression to select only of years,months and days.example if my output is 3 years=3years and not 3years,0month,0days, and 7months should only display 7 months and not 0years,7months,0days as well as days to be 6days rather than 0 years 0months and 6 days.
here is my code in my expression
=code.GetCustomDate(avg(Fields!SentenceLength.Value))
Public Function GetCustomDate(ByVal days As Int32) As String
Dim objDate1 As DateTime = DateTime.Now()
Dim objDate2 As DateTime = objDate1.AddDays(-1 * days)
Return "Years = " & (objDate1.Year - objDate2.Year) & " Months = " & (objDate1.Month - objDate2.Month) & " Days = " & (objDate1.Day - objDate2.Day)
End Function
thanks in advance