Saturday, 7 June 2014

how to calculate the difference between two datetimes in minutes with mysql

This is the simplest format of finding datetime difference in Minutes

select  TIMESTAMPDIFF(
MINUTE , '2013-10-19 10:42:53',  '2013-10-19 10:43:53' ) AS minutes from table name


 If u  want to give the column names to find datetime diference.....

select  TIMESTAMPDIFF(
MINUTE , colname1,  colname2 ) AS minutes from table name

No comments:

Post a Comment