I have a date field of type (type VARCHAR
) in my table, and I recently had to search the database with date range.
And for this I used the Between
operator, getting something like: BETWEEN 15/08/2015 AND 25/08/2015
. So good.
The problem is when I need to search from month to month, something like: BETWEEN 25/07/2015 AND 25/08/2015
, then it does not work, and I faithfully believe that this is due to the date field being type VARCHAR
and not type date.
I am willing to change the format of the dates to 0000-00-00, the problem is that at the time of capturing this data I can not show in this format, since here the default is 00/00/0000.
Well, I need to solve this, how do I format the 0000-00-00 format in 00/00/0000, or another way to search the range of records, in order not to use the date field for this.