[求助]计算两个日期列的工作日(已解决) Post By:2011/9/17 13:58:00 [只看该作者]
以下是计算两个日期列之间天数的代码,如果需要计算工作日,代码应该如何改,请各位老师指教,谢谢。
If e.DataRow.IsNull("借用日期") And e.DataRow.IsNull("归还日期") Then e.DataRow("借用天数")=Nothing Else Dim d1 As Date = e.DataRow("借用日期") Dim d2 As Date = e.DataRow("归还日期") If d1>d2 e.DataRow("借用天数") = 0 Else e.DataRow("借用天数") = (d2-d1).TotalDays End If End If