I am using mysql. I want to display records between two dates.
I searched through web and found that mysql's date format is yyyy/mm/dd.
so I am writing query as follows,
select
*
from tbl_reservation
where
current_date between '2014-03-28' and '2014-03-26';
But, I don't know why it is not working. "col_date" has DATE datatype. I am not storing time in it.
Let me give you some idea what i have done at back end,
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
Date curr_date=new Date();
String compareDate=sdf.format(curr_date);
And I am storing this value in "col_date". Is it happening because of this processing?
Thanks for your valuable time in advance.
Copyright Notice:Content Author:「Aditya Ekbote」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/23008860/mysql-between-query-not-working