=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) 'This has to be modified as not correct. Return "Years = " & (objDate1.Year - objDate2.Year) & " Months = " & (objDate1.Month - objDate2.Month) & " Days = " & (objDate1.Day - objDate2.Day) End Function
days
Dim timeSpan as System.TimeSpan timeSpan = objDate2 - objDate1; ' as simple as that
if iYear > 0 then sDisp = sDisp & iYear.tostring & "Years " End if
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)