I'm having a problem while doing a query using between with inner join, the query simply is not working, it returns the results as if the in between was not in the query. What am I doing wrong?
SELECT * FROM usuarios INNER JOIN matriculas ON (matriculas.idaluno = usuarios.id) WHERE matriculas.idcurso = :idcurso AND matriculas.data BETWEEN :dataini AND :datafim ORDER BY usuarios.nome ASC LIMIT 0,20
I'm putting everything right, including the dates I'm putting in the American standard Y-m-d which is what the operator between accepts. Without using inner join, the query works fine.
Remember that I'm using pdo.