bobrivers2003
Technical User
I have two field in a db, one called begin_time and one called end_time they are both stored as datetime types.
currently two entries are:
begin_time end_time
2007-04-12 12:18:00 2007-04-12 14:39:00
I need to work out the difference in hh:mm:ss between the begin and end times.
I have tried
select date_format(end_time, '%H:%i:%s') - date_format(begin_time, '%H:%i:%s') from tablename where id =1;
it just returns 2 in no format.
How do I get it to return the actual difference in hh:mm:ss?
Any help would be greatly appreciated
Thanks and regards
currently two entries are:
begin_time end_time
2007-04-12 12:18:00 2007-04-12 14:39:00
I need to work out the difference in hh:mm:ss between the begin and end times.
I have tried
select date_format(end_time, '%H:%i:%s') - date_format(begin_time, '%H:%i:%s') from tablename where id =1;
it just returns 2 in no format.
How do I get it to return the actual difference in hh:mm:ss?
Any help would be greatly appreciated
Thanks and regards