I am Writing a Between query with formatted date.. This is my query:
SELECT shop_id, date_format(registered_time,'%d-%m-%Y') as Date FROM shops where (date_format(registered_time,'%d-%m-%Y') BETWEEN '09-03-2016' AND '19-04-2016')
However, when I execute query, it gives my only the records between date 09 and 19 regardless of month. For example, I have records like 30-03-2016, 31-03-2016..but they are ignored.
If anyone can find anything out of this, please tell me..
One more thing is that, I am converting this date from time stamp field. I hope that isn't causing any issues.