I know for a fact that this isn't working as I've tried from command line (Syntax error near SEC_TO_TIME(seconds))...PHP Code:SELECT UNIX_TIMESTAMP(call_end)-UNIX_TIMESTAMP(call_start) AS seconds, SEC_TO_TIME(seconds)
FROM call_notes WHERE noteid=123
But I did successfully use this:
I have my call_time's stored as DATETIME. Since Mysql doesn't have a neatly built in tool for comparing two datetimes I am working on a solution that will do the same via Unix_Timestamp. I want to store my elapsed time as a TIME datatype, for consistancy (don't want two different time datatypes in the same table).PHP Code:mysql> select SEC_TO_TIME(63);
+-----------------+
| SEC_TO_TIME(63) |
+-----------------+
| 00:01:03 |
+-----------------+
1 row in set (0.00 sec)
Any suggestions?




Bookmarks