将当前审核时间写入单据自定义字段

alter trigger checktime on icstockbill
for update
as
declare @aa int,@bb int
select @aa=FStatus from deleted
select @bb=FStatus from inserted
if @aa=0
begin

  update b  set b.FHeadSelfb0122=convert(varchar,getdate(),120) from icstockbill b
      join inserted i on i.FInterID=i.FInterID and b.fbillno=i.fbillno
where B.Ftrantype=21 and b.fcheckerid is not null

end

你可能感兴趣的:(update,convert,审核,bb)