I am trying to calculate the difference between data in two columns of the datetime type for a row, and then assign it to a third column. I have tried reading up here on the forum, but I can’t seem to get it to work. What am I doing wrong?
Hi
hope this expression would help you on this
row(“Hours”) = (Datetime.ParseExact(row(“EndTime”).ToString.SubString(0,10),“MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture).Hour - Datetime.ParseExact(row(“StartTime”).ToString.SubString(0,10),“MM/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture).Hours).ToString