Select Case e.DataCol.Name
Case "下单日期"
Dim bh As String = Format(e.DataRow("下单日期"),"yyyymmdd")
If e.DataRow("订单编号").startswith(bh) = False Then
Dim max As String
Dim idx As Integer
max = e.DataTable.Compute("max(订单编号)", "下单日期 = #" & e.DataRow("下单日期") & "# And [_Identify] <> " & e.DataRow("_Identify"))
If max > "" Then
idx = CInt(max.SubString(8,3)) + 1
Else
idx = 1
End If
e.DataRow("订单编号") = bh & Format(idx,"000")
End If
End Select
为什么我的自动编号没有月份数???