UPDATE VS4TInventoryMB Set TInMTACPTACYID=Year((SELECT TInvDate From VS4TInventory WHERE VS4TInventory.TInvNo=VS4TInventoryMB.TInmTInvNo)),TInMTACPID=Month((SELECT TInvDate From VS4TInventory WHERE VS4TInventory.TInvNo=VS4TInventoryMB.TInmTInvNo))
GO