DECLARE @FATID INT = (SELECT MIN(FATID)-1 FROM FATURA WHERE KYTARIH>(CONVERT(VARCHAR,YEAR(DATEADD(MONTH,-2,GETDATE()))) + '-' + RIGHT('0'+CONVERT(VARCHAR,MONTH(DATEADD(MONTH,-2,GETDATE()))),2) + '-01'))
UPDATE FATISL SET NETTOPLAM = DBO.fn_RoundBanker(ADET*BFIYAT,2) - DBO.fn_IndirimTutar3lu(DBO.fn_RoundBanker(ADET*BFIYAT,2),SATIRIND,0,SATIRIND2,0,0,SATIRINDT) WHERE FATID>@FATID
