Example
Column A has 02:20
Column B has 00:30
Column C has 00:10
Total should display as 03:00
Please help how we add. Adding normally is not working showing incorrect result
Or same data i have in datatable how we add that in datatable. I mean if we didnt write in excel then are we able to calculate the time in DT table.
ppr
(Peter Preuss)
June 23, 2023, 9:02am
2
we can do:
So Just retrieve the time strings and sum it up as show cased above
My time is in DT how we pass that.
ppr
(Peter Preuss)
June 23, 2023, 9:10am
4
as a plain column value retrieval
Let’s assume you are looping over the rows with a For each row in Datatable | CurrentRow in YourDataTableVar
arrTimes = {"Column1","Column2","Column3"}.Select(Function (x) CurrentRow(x).toString.Trim).toArray
mySum = TimeSpan.FromTicks(arrTimes.Sum(Function (x) CDate(x).TimeOfDay.Ticks))
Sorry sir… Getting error i am doing something wrong.
Please guide
ppr
(Peter Preuss)
June 23, 2023, 9:18am
6
above was mentioned. A string Array with the column name from which you want to retrieve the time strings
Thanks sir…Still not get it. Let me see it. My column are not fixed.
I already stored data in table and from there how i iterate that value and add those.
Will check and look how i do it.
ppr
(Peter Preuss)
June 23, 2023, 9:31am
8
just redefine the requirement with all details and we check afterwards