3
In an input and output control system there is a table cad_entrada_saida
where it has two columns in the bank dEntrada
and dSaida
, these two columns are like varchar
and recording the data in the format dd/mm/yyyy H:i
defined by the former Developer.
When performing the SELECT
at this table using BETWEEN
dates are returned outside the defined range.
SELECT * FROM cad_entrada_saida
WHERE dEntrada BETWEEN '01/01/2017 06:00' AND '01/01/2017 23:00'
I’ve tried using the Function str_to_date
SELECT * FROM cad_entrada_saida WHERE dEntrada
BETWEEN str_to_date('01/01/2017 06:00', '%d/%m/%Y %H:%i') AND
str_to_date('01/01/2017 23:00', '%d/%m/%Y %H:%i')
Both queries return me dates outside this range.
Did Lucas give you any answer?
– novic