I need to get the record from one table where date between June-30-2011 and June-30-2012.
the problem is that the result is just only display the records of year 2012 although the table has records for year 2011.
below is my code
SELECT * FROM tbl_name where date between '06/30/2011' and '06/30/2012'
you need to convert it bact to
dateusingSTR_TO_DATE, egIt is not good to store
Datesas string on database because as you see it is hard to search for it, you need some extra functions to convert it back to date and to which I think it kills the index.If you have time or privilege to alter, fix the values and change it to
DateTimedata type.