end
else if ( datediff (day, @today , @prctmpdate ) > 0 ) --若当前日期〈上次日期 ,报错
begin
raiserror ('the db server date erreor check system date please!', 16, 1)
end
end
---------------------------------------------------------------------------------------------------------------
select @prctmpdate=predate,@tmpword=word, @tmpprenum=prenum from tbrecno where frecord=@precrecord
select @tmpprenum= --上次编号不够四位的补够四位
case len(ltrim(rtrim(@tmpprenum)))