【发布时间】:2015-02-22 15:37:29
【问题描述】:
我有一列时间值,我想对这些值求和,但是当一个字段为空时,会显示错误 #error,我使用了 iif (isnothing(attTime),0,attTime)条件但是这个整数错误然后我使用了 00:00 但它出现了 12 小时和总和 12
我使用的这段代码
= Right("0" & Sum(CInt(Left(CDate(Fields!timeAtt.Value.ToString()).ToString("hh:mm"),2)), "DataSet1") + Floor(Sum(CInt(Right(CDate(Fields!timeAtt.Value.ToString()).ToString("hh:mm"),2)), "DataSet1") / 60),2) & ":" & Sum(CInt(Right(CDate(Fields!timeAtt.Value.ToString()).ToString("hh:mm"),2)), "DataSet1") Mod 60
所以请我想对字段求和并避免空字段
【问题讨论】:
-
你能控制你的数据库查询吗?如果是,那么发布您的查询?而且还不清楚您要通过复杂的表达来做什么。你能用例子解释一下吗?可能有您想要实现的简单解决方案。
-
“从出席表中选择 hoursAtt”所以我想要总小时数,但空字段阻止我
-
您不能将您的查询更改为
select hoursAtt from attendanceTable where hoursAtt is not NULL吗? -
No.. 我想显示空白字段
标签: sql-server reporting-services ssrs-2008