php - Unable to get "inbetween" records if year is different -


i having unique bug

table : tbl id | title | iscancel | sold_dt  id: uid title : varchar iscancel : 0/1 sold_dt : timestamp   select * tbl iscancel = 0 , date_format(sold_dt,"%m/%d/%y") between "06/01/2015" , "03/01/2016" group day(sold_dt) order (sold_dt) asc  

(note year different)

  • 0 records returned

but if do

select * tbl iscancel = 0 , date_format(sold_dt,"%m/%d/%y") between "06/01/2015" , "12/01/2015" group day(sold_dt) order (sold_dt) asc  

or

select * tbl iscancel = 0 , date_format(sold_dt,"%m/%d/%y") between "01/01/2016" , "03/01/2016" group day(sold_dt) order (sold_dt) asc  

(note year same)

-i'll records

*used date_format because calendar giving me mm/dd/yyyy (i can not change since might affect other areas)

what doing wrong?

instead of converting stored value format try changing parameter correct format. if cant on website can in query well

sold_dt between str_to_date('06/01/2015', '%m/%d/%y') , str_to_date('03/01/2016', '%m/%d/%y')     

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -