Select all records between two datetime format

date, date-format, mysql, sql

Solution

Try this instead:

select * from cdr
WHERE DATE(calldate) BETWEEN '20121201' AND '20121203';

Problem

I have this query, i need to select all records between two dates, the mysql table is a datetime format. I tried this but it didn't work. ``` select * from cdr WHERE calldate BETWEEN '2012-12-01' AND '2012-12-03'; ```

Original source