恩,非常感谢,找到了。还有我把这段程序插到新建的项目里后,发现杂项输出结构里第一,二,三列仍然是字符型,而它应该是日期型或其它才对,我应该怎么把它变成日期型啊?我下面这段小程序有没有什么问题啊?谢谢了(程序目的是:先求出两个时间段,再求两段的和,其中求时间段时,某个时间可能是空的)再次谢谢了
Select Case e.DataCol.Name
Case "第一列","第二列"
If e.DataRow.IsNull("第一列") and e.DataRow.IsNull("第二列") Then
e.DataRow("第五列") = Nothing
Else if e.DataRow.IsNull("第一列")
e.DataRow("第五列") = (e.DataRow("第二列") -"#某个时间#").TotalHours
Else if e.DataRow.IsNull("第二列")
e.DataRow("第五列") = ("#某个时间#")-e.DataRow("第二列")) TotalHours
else
e.DataRow("第五列") = (e.DataRow("第二列") - e.DataRow("第一列")).TotalHours
End If
case "第三列","第四列"
If e.DataRow.IsNull("第三列") and e.DataRow.IsNull("第四列") Then
e.DataRow("第六列") = Nothing
Else if e.DataRow.IsNull("第三列")
e.DataRow("第六列") = (e.DataRow("第四列") -"#某个时间#").TotalHours
Else if e.DataRow.IsNull("第四列")
e.DataRow("第六列") = ("#某个时间#")-e.DataRow("第三列")) TotalHours
else
e.DataRow("第六列") = (e.DataRow("第四列") - e.DataRow("第三列")).TotalHours
End If
e.datarouw("第七列")=(e.DataRow("第五列") + e.DataRow("第六列")).TotalHoursEnd Select
end select