Problem with conditional mysql query

0

I'm doing a select to get the records between two dates but how much I use the conditional of (>) or (<) does not work for me since it does not show me any information with only (=) if it shows me the records but those that are equal to the dates and so it does not help me, could guide me that I am doing wrong.

SELECT roles_turno_emp.nomina, 
       empleado.nombre, 
       empleado.ruta, 
       roles_turno_emp.turno, 
       roles_turno_emp.f_inicial, 
       roles_turno_emp.f_final 
       FROM roles_turno_emp 
       INNER JOIN empleado on empleado.nomina=roles_turno_emp.nomina 
       WHERE roles_turno_emp.F_INICIAL > "2018-12-13" AND 
       roles_turno_emp.F_FINAL < "2018-12-21"
    
asked by Xavi 13.12.2018 в 19:35
source

1 answer

0

Try adding a BETWEEN like this:

SELECT roles_turno_emp.nomina, 
       empleado.nombre, 
       empleado.ruta, 
       roles_turno_emp.turno, 
       roles_turno_emp.f_inicial, 
       roles_turno_emp.f_final 
       FROM roles_turno_emp 
       INNER JOIN empleado on empleado.nomina=roles_turno_emp.nomina 
       WHERE roles_turno_emp.F_INICIAL 
      BETWEEN "2018-12-13" AND roles_turno_emp.F_FINAL  "2018-12-21"
    
answered by 13.12.2018 / 19:38
source