Select Case e.DataCol.Name Case "交付日期","退回日期","移机日期","改期日期" Dim ary() As String = {"退回日期","移机日期","改期日期"} Dim d As Date = Date.Today For Each s As String In ary If e.DataRow(s) <> Nothing Then d = e.DataRow(s) Exit For End If Next Dim y,m,d1 As Integer DateYMD(e.DataRow("交付日期"),d,y,m,d1) e.DataRow("应结算月") = y*12+m End Select