'参考 Dim str As String For Each dr As DataRow In DataTables("表C").Select("订单ID > ''","订单ID desc") If str <> dr("订单ID").SubString(2,4) Then str= dr("订单ID").SubString(2,4) output.show("最大订单: " & dr("订单ID")) output.show(Format( dr("订单ID").SubString(7)+1,"0000")) End If Next