calculate max(zidbh2) TO zidno11
zidno21=val(right(zidno11,7))
if zidno21=0 then
zidno21='QGD0000001'
else
zidno21='QGD'+padl(alltrim(str(zidno21+1)),7,'0')
ENDIF
自己写代码就可以了
在添加记录时可以用下面示例代码自动生成编号
select count(*) from a.dbf into array intIdCount
if intIdCount=0
intNewId=1
else
select max(id) from a.dbf into array arrMaxId
intNewId=arrMaxId+1
endif
replace id with intNewId