update vs4tinventory set tinvflag3=0,tinvapprovestatus=1 where tinvtintalias='SALEOUTPOS'

update vs4tinventory set tinvflag3=0,TInvTACPTACYID=Year(TInvDate),TInvTACPID=Month(TInvDate) where TInvTACPTACYID is null or TInvTACPID is null

update vs4tinventory set tinvflag3=0,tinvtjpdno='' where tinvtjpdno='0' or tinvtjpdno is null

UPDATE VS4TInventoryMB set tinmflag3=0,TInMScrapLevel='' WHERE TInMScrapLevel is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMReserve=0 WHERE TInMReserve is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMUnitcost=0 WHERE TInMUnitcost is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMAmount=0 WHERE TInMAmount is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMStatus=1 WHERE TInMStatus is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMPremiumNote='' WHERE TInMPremiumNote is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMCustom1='' WHERE TInMCustom1 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMCustom2='' WHERE TInMCustom2 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMCustom3='' WHERE TInMCustom3 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMNoExpire=0 WHERE TInMNoExpire is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMTCGTID=0 WHERE TInMTCGTID is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMExpireDate='8/8/8888' WHERE TInMNoExpire=0

UPDATE VS4TInventoryMB set tinmflag3=0,TInMJobCode='' WHERE TInMJobCode is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMTUntCode='' WHERE TInMTUntCode is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMLotNo='' WHERE TInMLotNo is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMLotNo2='' WHERE TInMLotNo2 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMLotDate='8/8/8888' WHERE TInMLotDate is null

UPDATE VS4TInventoryMB set tinmflag3=0,TInMLotDate='8/8/8888' WHERE TInMLotDate=0

UPDATE VS4TInventoryMB set tinmflag3=0,TInMCustom4='' WHERE TInMCustom4 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMCustom5='' WHERE TInMCustom5 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMSerialNo='' WHERE TInMSerialNo is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMGrade='' WHERE TInMGrade is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMIsPremium=0 WHERE TInMIsPremium is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMUnitRatio=1 WHERE TInMUnitRatio is NULL or TInMUnitRatio=0

UPDATE VS4TInventoryMB set tinmflag3=0,TInMInQuantity=0 WHERE TInMInQuantity is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMOutQuantity=0 WHERE TInMOutQuantity is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMAmouQuantity=0 WHERE TInMAmouQuantity is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMInQuantity2=0 WHERE TInMInQuantity2 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMOutQuantity2=0 WHERE TInMOutQuantity2 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMAmouQuantity2=0 WHERE TInMAmouQuantity2 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMInQuantity3=0 WHERE TInMInQuantity3 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMOutQuantity3=0 WHERE TInMOutQuantity3 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMAmouQuantity3=0 WHERE TInMAmouQuantity3 is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMPerQuantity=1 WHERE TInMPerQuantity is NULL or TInMPerQuantity=0

UPDATE VS4TInventoryMB set tinmflag3=0,TInMQuantityBase=(TInMUnitRatio*TInMAmouQuantity)

UPDATE VS4TInventoryMB set tinmflag3=0,TInMUnitCalc=0 WHERE TInMUnitCalc is NULL

UPDATE VS4TInventoryMB set tinmflag3=0,TInMQuantityCalc=TInMAmouQuantity where TInMUnitCalc=0

UPDATE VS4TInventoryMB set tinmflag3=0,TInMQuantityCalc=TInMAmouQuantity2 where TInMUnitCalc=1

UPDATE VS4TInventoryMB set tinmflag3=0,TInMQuantityCalc=TInMAmouQuantity3 where TInMUnitCalc=2

UPDATE VS4TInventoryMB set tinmflag3=0,TInMAmount=(abs(TInMUnitCost)*TInMQuantityCalc)