In MySQL I have a table that has two DATE fields: data_inicial
and data_final
.
In the System I have a Field (TextField) where I type a date.
This date does not need to be accurate, but rather matches the range.
Example:
Field Value: 2015-10-05
Values in the Table:
Start_Date | Date_Final:
2014-12-18 2015-12-18
2015-12-19 2016-12-19
My SQL:
SELECT Id, data_inicial, data_final, valor FROM periodos WHERE PasseioId = 1 and (data_inicial >= 2015-10-14 and data_final <= 2015-10-14)