Bug #37106 | SELECT (datetimeB - datetimeA) | ||
---|---|---|---|
Submitted: | 30 May 2008 16:43 | Modified: | 31 May 2008 17:05 |
Reporter: | Santiago Trebucq | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 5.0.22 | OS: | Linux (Debian_0ubuntu6.06.9) |
Assigned to: | CPU Architecture: | Any | |
Tags: | SUBSTRACT DATETIME in SELECT CLAUSE |
[30 May 2008 16:43]
Santiago Trebucq
[31 May 2008 17:05]
Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php When you substract DATETIME values using operator '-' DATETIME values are converted to double hence the result. Please use functiion TIMEDIFF instead http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff