I need difference in minutes between two dates and tried this version:
mysql>
SELECT
DATE_ADD(
STR_TO_DATE(
'15/01/2012 08:02:00',
'%d/%m/%Y %h:%i:%s'
) INTERVAL STR_TO_DATE(
'14/01/2012 08:00:00',
'%d/%m/%Y %h:%i:%s') MINUTE
) AS output;
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTERVAL STR_TO_DATE(
'14/01/2012 08:00:00',
'%d/%m/%Y %h:%i:%s' MINUTE' at line 6