SELECT DailyLog.TimeOut, DailyLog.TimeIn, SEC_TO_TIME(UNIX_TIMESTAMP(DailyLog.TimeOut) - UNIX_TIMESTAMP(DailyLog.TimeIn)) as test FROM DailyLog
keeps on giving me a result as a date. Not time in years, days, hours, min. For example 9/9/2007 12:51:26 PM - 9/9/2007 12:51:26 PM gives me 12:00 PM. I want 0.
The simple example select SEC_TO_TIME(88) gives me 12:01:28 AM. Is there a setting in mysql that I'm missing?
SEC_TO_TIME() doesn't produce a value with a date part. It converts a number of seconds to a TIME value.
mysql> SELECT SEC_TO_TIME(88); +-----------------+ | SEC_TO_TIME(88) | +-----------------+ | 00:01:28 | +-----------------+
That means "1 minute, 28 seconds", not "12:01:28 AM".
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- Paul DuBois, Senior Technical Writer Madison, Wisconsin, USA MySQL AB, www.mysql.com
Are you MySQL certified? http://www.mysql.com/certification/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]