RDLC 中的求和时间 (HH:MM) [英] Sum Time (HH:MM) in RDLC
本文介绍了RDLC 中的求和时间 (HH:MM)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我和 RDLC 报告说我需要获取字段时间"的总和.我用 varchar 类型将它保存在数据库中,格式为hh:mm".
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".
我得到这个公式:
=(Sum(System.TimeSpan.Parse(Fields!HorasEfectivas.Value).Hours))
&":"&
Sum(System.TimeSpan.Parse(Fields!HorasEfectivas.Value).Minutes))
这里的问题是分钟的总和.140分钟应该变成几小时!我怎样才能得到这个?问候
The problem here is the sum of the minutes. 140 minutes shoul be transformed in hours! How can I get this? Regards
推荐答案
尝试使用 TimeSpan,例如
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;
这篇关于RDLC 中的求和时间 (HH:MM)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文