Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Trigger

Status
Not open for further replies.

Cecass

Technical User
Jan 14, 2005
4
GB
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.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top