MySQL Forums
Forum List  »  Triggers

Re: Calculation from time stamps through to amount due
Posted by: Kailas Natha
Date: September 04, 2016 04:45PM

delimiter go

CREATE trigger calculate_time_rate
BEFORE insert
ON admin_time_tracker
FOR each row


BEGIN
set new.elapsed=(TIMESTAMPDIFF(MINUTE , new.start_time , new.end_time ) / 60.00)
new.amount_due=(new.elapsed * rate)

END;
go
delimiter ;


error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'new.amount_due=(new.elapsed * rate) END' at line 9

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Calculation from time stamps through to amount due
922
September 04, 2016 04:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.