问题
I have and RDLC report an I need to get the sum of the fild "Time". I save it in the database with varchar type with the format "hh:mm".
I get this with the formula:
=(Sum(System.TimeSpan.Parse(Fields!HorasEfectivas.Value).Hours))
&":"&
Sum(System.TimeSpan.Parse(Fields!HorasEfectivas.Value).Minutes))
The problem here is the sum of the minutes. 140 minutes shoul be transformed in hours! How can I get this? Regards
回答1:
try using TimeSpan e.g.
var time1 = new TimeSpan(0,2,02,0);
var time2 = new TimeSpan(0, 5, 02, 0);
var totalHours = time1 + time2;
来源:https://stackoverflow.com/questions/26740728/sum-time-hhmm-in-rdlc