Can anyone help?
I want to create a trigger to replace the following update:
UPDATE SERVICES.dbo.SICKNESS
SET HOURS = ((CONTRACTUALHOURS/5)*DAYS),
COST = (((CONTRACTUALHOURS/5)*DAYS) * HOURLYRATE),
TOTALCOST = (((((CONTRACTUALHOURS/5)*DAYS) * HOURLYRATE)+ ONCOST)+ ADDITIONALCOST)
FROM SERVICES.dbo.SICKNESS a JOIN SERVICES.dbo.CURRENTPAY b
ON a.EMPLOYEENO = b.EMPLOYEENO
DAYS is created as the difference between a Start and End date and I want HOURS, COST and TOTALCOST to populate automatically after these two dates are entered.
CONTRACTUALHOURS and HOURLYRATE are taken from the table CURRENTPAY.
I want to create a trigger to replace the following update:
UPDATE SERVICES.dbo.SICKNESS
SET HOURS = ((CONTRACTUALHOURS/5)*DAYS),
COST = (((CONTRACTUALHOURS/5)*DAYS) * HOURLYRATE),
TOTALCOST = (((((CONTRACTUALHOURS/5)*DAYS) * HOURLYRATE)+ ONCOST)+ ADDITIONALCOST)
FROM SERVICES.dbo.SICKNESS a JOIN SERVICES.dbo.CURRENTPAY b
ON a.EMPLOYEENO = b.EMPLOYEENO
DAYS is created as the difference between a Start and End date and I want HOURS, COST and TOTALCOST to populate automatically after these two dates are entered.
CONTRACTUALHOURS and HOURLYRATE are taken from the table CURRENTPAY.