sql - mysql DATE_FORMAT() between gives me bug -


i trying folowing on my_table modifiedtime of type datetime

select date_format(modifiedtime,'%d-%m-%y') my_table date_format(modifiedtime,'%d-%m-%y') between '05-11-2013' , '28-11-2013'; 

the query gives me other record not falls between above dates, example there record in result set dated '04-01-2014'

select date_format(modifiedtime,'%d-%m-%y') my_table     date_format(modifiedtime,'%d-%m-%y')='05-11-2013' 

this query works fine , gives records given date

why first behaves that? how can correct it? efficient way implement it? 

such can records between given 2 dates.

select      date_format(modifiedtime, '%d-%m-%y')     my_table     modifiedtime between str_to_date('05-11-2013', '%d-%m-%y') , str_to_date('28-11-2013', '%d-%m-%y'); 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -