简体   繁体   English

RDLC报告-如何从小时数(分钟)中计算总时数

[英]RDLC Report - How to calculate Total Hours from Time in Hours:Minutes

I am using RDLC Report. 我正在使用RDLC报告。 My requirement is, I need to calculate total Hours from values like 9:45 10:02 我的要求是,我需要从类似9:45 10:02的值计算总时数

11:00 11:00

Main thing is it including blank values. 最主要的是它包括空白值。 So How I need to make equation for RDLC Report for getting total hours:minutes. 因此,我如何为RDLC报告建立方程式以获取总时数:分钟。

My current equation is as per below but it gives me #error : 我当前的等式如下所示,但它给了我#error:

=(TimeSpan.FromTicks(Sum(IIf((Fields!TimeDiff.Value) = " " , System.TimeSpan.Parse("00:00:00"), System.TimeSpan.Parse(Fields!TimeDiff.Value)))).Days * 24 + 
TimeSpan.FromTicks(Sum(IIf((Fields!TimeDiff.Value) = " ", System.TimeSpan.Parse("00:00:00"), System.TimeSpan.Parse(Fields!TimeDiff.Value)))).Hours).ToString +":" + 
TimeSpan.FromTicks(Sum(IIf((Fields!TimeDiff.Value) = " ", System.TimeSpan.Parse("00:00:00"), System.TimeSpan.Parse(Fields!TimeDiff.Value)))).Minutes.ToString("d2")

Thanks for your help. 谢谢你的帮助。

您可以使用此:

System.TimeSpan.FromTicks(sum(Fields!TimeDiff.Value))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM