1
I am generating a report between date, as the figure below:
However, when I enter the starting date:
Initial year: 2014 Initial month: 6 and
Final year: 2015 Final month: 5
does not bring the data, the query interprets that initial month 6 is greater than final month 5.
If I use the clause IN
the query returns only the months 6 and 5 and not returning the month 4, but when used the BETWEEN
does not return any data.
Follow the consultation.
BETWEEN
WHERE v.verba_ano BETWEEN $ano AND $ano_fnal AND v.verba_mes BETWEEN $mes AND $mes_fim
IN
$WHERE= "WHERE v.verba_ano IN($ano,$ano_fnal) AND v.verba_mes IN($mes,$mes_fim)";
It’s in PHP, right ?
– gmsantos