calculate datetime difference
Posted: Thu Jul 15, 2010 11:09 am
Hello,
I have a table with a starttime and stoptime column in datetime format. I would like a third "timediff" column to be updated automatically. Is there an easy way to do this, I don't have any experience in php and very little sql and was hoping to be able to write something like:
__sql__ = "SELECT ID, stoptime - starttime FROM table" or
__sql__ = "SELECT TIMEDIFF(stoptime - starttime) FROM table"
in fields.ini or valuelists.ini - that does'nt work though...
Thank you!
I have a table with a starttime and stoptime column in datetime format. I would like a third "timediff" column to be updated automatically. Is there an easy way to do this, I don't have any experience in php and very little sql and was hoping to be able to write something like:
__sql__ = "SELECT ID, stoptime - starttime FROM table" or
__sql__ = "SELECT TIMEDIFF(stoptime - starttime) FROM table"
in fields.ini or valuelists.ini - that does'nt work though...
Thank you!