此主题相关图片如下:111.png

我这个日期天数,只能天数相减,月、年减不了,这个怎么回事呢
Select e.DataCol.Name
Case "售粮日期" ,"日期"
If e.DataRow.IsNull("日期") OrElse e.DataRow.IsNull("售粮日期") Then
e.DataRow("天数") = Nothing
Else
Dim dt1 As Date = e.DataRow("日期")
Dim dt2 As Date = e.DataRow("售粮日期")
Dim d= (dt1-dt2).TotalDays()
e.DataRow("天数") = d
End If
End Select