RDLC报告 - 如何计算从小时开始的总小时数:分钟

时间:2021-09-22 02:59:37

I am using RDLC Report. My requirement is, I need to calculate total Hours from values like 9:45 10:02

我正在使用RDLC报告。我的要求是,我需要从像9:45 10:02这样的值计算总小时数

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.

谢谢你的帮助。

1 个解决方案

#1


1  

You can use this:

你可以用这个:

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

#1


1  

You can use this:

你可以用这个:

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