MySQL Forums
Forum List  »  Triggers

Re: Calculation from time stamps through to amount due
Posted by: Kailas Natha
Date: September 03, 2016 08:01PM

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

generates this error:

The following query has failed: "CREATE DEFINER=`devhap`@`localhost` TRIGGER `calculate_elapsed_time` BEFORE INSERT ON `admin_time_tracker` FOR EACH ROW set new.elapsed=(TIMESTAMPDIFF(MINUTE , new.start_time , new.end_time ) / 60.00); set new.amount_due=(new.elapsed * rate)"
MySQL said: #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 'set new.amount_due=(new.elapsed * rate)' at line 2

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Calculation from time stamps through to amount due
531
September 03, 2016 08:01PM


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.