Difference in minutes between two dates

hi, hope in your help.

this query working:

mysql> SELECT
	DATEDIFF(
		STR_TO_DATE(
			'15/01/2012 08:02:00',
			'%d/%m/%Y %h:%i:%s'
		),
		STR_TO_DATE(
			'14/01/2012 08:00:00',
			'%d/%m/%Y %h:%i:%s'
		)
	) AS output;
+--------+
| output |
+--------+
|      1 |
+--------+

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

Can you help me?
thank you

Solved ?:


mysql> SELECT
	TIME_TO_SEC(
		TIMEDIFF(
			STR_TO_DATE(
				'15/01/2012 08:02:00',
				'%d/%m/%Y %h:%i:%s'
			),
			STR_TO_DATE(
				'14/01/2012 08:00:00',
				'%d/%m/%Y %h:%i:%s'
			)
		)
	) / 60 AS output;
+--------+
| output |
+--------+
| 1442   |
+--------+
1 row in set

you cannot add an interval which is a date

and once again, you are making things more difficult for yourself needlessly

difference in minutes –

SELECT ( UNIX_TIMESTAMP('2012-01-15 08:02:00') -
         UNIX_TIMESTAMP('2012-01-14 08:00:00') ) / 60 AS diff_minutes

thanks.

mysql> SELECT
	ROUND(
		(
			UNIX_TIMESTAMP('2012-01-15 08:02:00') - UNIX_TIMESTAMP('2012-01-14 08:00:00')
		) / 60,
		0
	) AS diff_minutes;
+--------------+
| diff_minutes |
+--------------+
| 1442         |
+--------------+
1 row in set