The code is as follows:
SELECT data
FROM lista
WHERE data BETWEEN '01-08-2015'
AND '05-08-2015';
The problem is that the date column is a varchar and I would like to use it as a date
The code is as follows:
SELECT data
FROM lista
WHERE data BETWEEN '01-08-2015'
AND '05-08-2015';
The problem is that the date column is a varchar and I would like to use it as a date
If it is SQL you can use the convert
function.
SQL
SELECT data
FROM lista
WHERE data BETWEEN convert(datetime,'01/08/2015', 103)
AND convert(datetime,'05/08/2015',103);
MySQL
SELECT data
FROM lista
WHERE data BETWEEN DATE_FORMAT(STR_TO_DATE('01/08/2015', '%d/%m/%Y'), '%Y-%m-%d %H:%m:%s')
AND WHERE data BETWEEN DATE_FORMAT(STR_TO_DATE('05/08/2015', '%d/%m/%Y'), '%Y-%m-%d %H:%m:%s')