Jump to content

Help needed to add a calculation field on MySQL...


Recommended Posts

Hi all


Noob here! :)


I am busy writing a web app that posts fuel usage data  into a MySQL DB.


Some records get added into the DB on the day that the vehicle leave the site. This will include the 'OpenKM' field. On the return of the vehicle the 'CloseKM' gets updated (added) into the record. I would like to have 'Consump' field to contain (CloseKM-OpenKM)/(MillDiesel+OutDiesel)


I am trying to figure out SQL Triggers, is that what I need to use to have this working?



Any help would be greatly appreciated.



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.