update acmast set r = 1 ,t = 1, edt= getdate() where acmastid not in (select isnull(acsubid ,'') from voucher where r = 0) and type = 3 and acparentid = 'J'(head xml )