|
回帖奖励 +3 点金钱
本帖最后由 易青城 于 2014-4-15 00:50 编辑
。。。
Set MySet = dbs.OpenRecordset("SELECT COUNT(*) FROM [表] where Left([编号],6)='" & "KT" + Format(Right(Year(Date), 2), "00") + Format(Month(Date), "00") & "';")
If MySet(0) = 0 Then
编号 = "KT" + Format(Right(Year(Date), 2), "00") + Format(Month(Date), "00") + "01"
Else
Set MySet = dbs.OpenRecordset("SELECT max(val(right([编号],6))) FROM [表] where Left([编号],8)='" & "KT" + Format(Right(Year(Date), 2), "00") + Format(Month(Date), "00") & "';")
编号 = "KT" + Format(Right(Year(Date), 2), "00") + Format(Month(Date), "00") + Format(Right(MySet(0), 2) + 1, "00")
End If
Set MySet = Nothing
。。。
|
|