I've been having some 'strange' results while comparing dates.
table1
has two rows with TIMESTAMPS values 2009-08-26 23:39:56
and 2009-08-27 00:01:42
When I make this query:
select * from table1 c
INNER JOIN table2 r ON r.table1_id = c.id
WHERE DATE(c.authorization_date) = '2009-08-26'
it returns both rows (when it only should have returned one).
For added weirdness the rows in the returned resultSet have tha same value: 2009-08-26 23:39:56
But If I make this query:
SELECT DATE(authorization_date) FROM table1
It correctly returns two rows with values 2009-08-26
and 2009-08-27
So, here comes my questions. How could I make the comparison so the correct result is returned, what am i doing wrong? Could be related to the inner join?