Estoy haciendo un sistema que devuelva true o false en caso de que haya o no mantenimiento, esta es mi consulta:
Código MySQL:
Ver original
En la base de datos tengo la tabla maintenances, con las columnas id, starting, ending y el motivo.
Las columnas starting y ending son en formato datetime (yyyy-mm-dd hh:ss:mm)
¿Qué falla?. Me devuelve:
Código:
Lo he intentado todo, sin convert, sin between comprobando mayor y menor que con now, and,... y nada.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'starting, 120) AND CONVERT(datetime, ending, 120)' at line 1
¡Muchas gracias! :) por cierto, sí, la conexión y todo está correcto, debería funcionar.