MySQL Check if Varchar Date is Between String Dates -
i have sql database have field holds date 01/31/2014 , of varchar type. though have access database changing construction off limits of now.
is there way check if string date in javascript between varchar type date in database?
the error getting when take search dates between (e.g. 08/31/2013 , 12/31/2013) yields right query results, when search dates between (e.g. 08/31/2013 , 01/01/2014) no results found quest though there is.
i believe error date column's construction not beingness date. true , how can overcome problem?
the sql looking believe is:
where str_to_date(column, '%m/%/d/%y') between str_to_date(column, '%m/%/d/%y') , str_to_date(column, '%m/%/d/%y') mysql has str_to_date function, can utilize parse string date object in mysql. can utilize between keyword comparison.
my suggestion store dates in millisecond format. create lot less confusion , hassle, , standard across many coding languages. create comparing , converting dates easier.
mysql
No comments:
Post a Comment