Time between two DATETIMEs

2001-02-20 Thread Duncan Hudson
I have a table that contains two datetime columns, and I need to determine the time between the two dates. So, what I've been doing is just subtracting what I know is the later date from the earlier date. But that's obviously not the way to do it as my results don't relate to anything. Here's

Re: Time between two DATETIMEs

2001-02-20 Thread Atle Veka
You could use the UNIX_TIMESTAMP() function to easily determine the difference in seconds between the two dates. select UNIX_TIMESTAMP( Datetime_A ) ... and the do the time_a - time_b thing. there might be a simple query that will work as well, but I don't know the mysql date queries that good