Re: Calculation from time stamps through to amount due
Sorry I was not explicit enough
Developer start_time end_time elapsed rate amount_due
Peter 2016-04-10 21:00:00 2016-04-11 02:00:00 5 $40.00 $200.00
where
start_time
end_time
rate
are static data entries being posted to the webserver from a desktop client via CGI/POST
and
elapsed and amount_due are generated by the trigger
This is working:
set new.elapsed=(TIMESTAMPDIFF(MINUTE , new.start_time , new.end_time ) / 60.00)
to generate the "5" (hours) so I get the elapsed time; now we to take the next step and times that by the rate to get amount_due
set new.elapsed=(TIMESTAMPDIFF(MINUTE , new.start_time , new.end_time ) / 60.00);
set new amount_due = (elapsed * rate)'
throws an error.
I'm looking around to do my homework but not seeing examples of this kind of sequential calculation where new values obviously have to be "rendered" first and then operated on, second.
yes, you are proably right, but how to "check for elapsed" before doing the next calculation?
Subject
Views
Written By
Posted
1750
September 02, 2016 07:35PM
880
September 02, 2016 09:26PM
862
September 03, 2016 06:42PM
Re: Calculation from time stamps through to amount due
842
September 03, 2016 06:51PM
883
September 03, 2016 07:23PM
1006
September 03, 2016 08:01PM
868
September 04, 2016 12:01PM
925
September 04, 2016 01:29PM
1009
September 04, 2016 01:42PM
907
September 04, 2016 04:45PM
886
September 04, 2016 04:53PM
939
September 04, 2016 07:32PM
937
September 04, 2016 09:30PM
914
September 05, 2016 02:46PM
940
September 05, 2016 04:10PM
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.