想一想,二楼的不对,再改一下。
If e.DataCol.name = "日期" Then
Dim d As Date = e.DataRow("日期")
Dim d1 As Date = new Date(d.Year, 2, 15)
Dim d2 As Date = new Date(d.Year, 7, 10)
Dim d3 As Date = new Date(d.Year, 7, 16)
Dim d4 As Date = new Date(d.Year, 12, 31)
Dim d5 As Date = new Date(d.year+1, 2, 14)
If d >= d1 AndAlso d <= d2 Then
e.DataRow("学期") = d.Year & "年(春)"
Else If d >= d3 AndAlso d <= d4 Then
e.DataRow("学期") = d.Year & "年(秋)"
Else If d > d4 AndAlso d <= d5 Then
e.DataRow("学期") = (d.Year-1) & "年(秋)"
End If
End If