0% found this document useful (0 votes)
29 views1 page

SQL Server 5

The document contains a series of SQL update statements that are modifying fields in a database table called Ki_per. The updates include: setting the Nimp field to 0 or other calculated values, calculating the Rirg field based on the value of Nimp and various formulas, calculating the Ret_source field based on other fields, and setting the Tr and Ntp fields based on calculations with other fields. The end result is modifying multiple fields in the Ki_per table based on complex calculations and updates to other related fields.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

SQL Server 5

The document contains a series of SQL update statements that are modifying fields in a database table called Ki_per. The updates include: setting the Nimp field to 0 or other calculated values, calculating the Rirg field based on the value of Nimp and various formulas, calculating the Ret_source field based on other fields, and setting the Tr and Ntp fields based on calculations with other fields. The end result is modifying multiple fields in the Ki_per table based on complex calculations and updates to other related fields.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

update Ki_per set Nimp = 0

update Ki_per set Nimp = Simp where Simp>0


update Ki_per set Nimp = floor (Nimp)
update Ki_per set Nimp = Nimp -5.00
update Ki_per set Nimp = round (Nimp,-1)
update Ki_per set Rirg = 0 WHERE Nimp < 30000.00
update Ki_per set Rirg = ((Nimp-20000.00)*0.23-1000.00)*(137/51)-(27925/8) WHERE
(Nimp > 30000.00) AND (Nimp < 30870.00)
update Ki_per set Rirg = ((Nimp-20000.00)*0.23-(Nimp-20000.00)*0.23*0.4)*(137/51)-
(27925/8) WHERE (Nimp >= 30870.00) AND (Nimp =< 35000.00)
update Ki_per set Rirg = ((Nimp-20000.00)*0.23-(Nimp-20000.00)*0.23*0.4) WHERE
(Nimp > 35000.00) AND (Nimp =< 36300.00)
update Ki_per set Rirg = ((Nimp-20000.00)*0.23-1500) WHERE (Nimp > 36300.00) AND
(Nimp =< 40000.00)
update Ki_per set Rirg = ((Nimp-40000.00)*0.27+3100.00) WHERE (Nimp >= 40000.00)
AND (Nimp =< 80000.00)
update Ki_per set Rirg = ((Nimp-80000.00)*0.30+13900.00) WHERE (Nimp > 80000.00)
AND (Nimp =<160000.00)
update Ki_per set Rirg = ((Nimp-160000.00)*0.33+37900) WHERE (Nimp > 160000.00)
AND (Nimp =<320000.00)
update Ki_per set Rirg = ((Nimp-160000.00)*0.35+90700) WHERE (Nimp > 320000.00)
update Ki_per set Rirg = round (Rirg,1)
REPLACE all ki_per.Ret_source WITH ((Spt-Rss-Rirg)/30) *100 FOR Abscence>0
update Ki_per set Ret_source = floor (Ret_source)
update Ki_per set Ret_source = Ret_source/100 *Abscence
REPLACE all ki_per.Tr WITH Rss+Rirg+Ret_source
REPLACE all ki_per.Ntp WITH Brut-tr-Oeuvres-Precompte

You might also like