1
"SELECT at.codigoTurma, "
"ADDTIME(t.horaInicioCurso, '00:01:00'), "
"t.toleranciaCurso, "
"t.horaFinalCurso "
"FROM AlunosTurmas at "
"INNER JOIN Turmas t "
"ON t.codigoTurma = at.codigoTurma "
"WHERE at.matriculaAluno = :matricula "
"ORDER BY t.horaInicioCurso"
I’d like to use the field t.toleranciaCurso
, in function ADDTIME
, in place of minutes.
t.tolerancia(INT), t.horaInicioCurso(TIME).
ADDTIME(t.horaInicioCurso, '00:' + t.toleranciaCurso + ':00') // soma apenas segundos
And why not use? Gives some error? Any wrong result? What kind are the columns? In case
t.toleranciaCurso
needs to be theTIME
or you need to convert to this type ((STR_TO_DATE)[https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_str-to-date]). by the column description, it should be of this type. If it is not, there is already a mistake there. Can you fix this? https://dev.mysql.com/doc/refman/5.6/en/date-and-time-type-conversion.html– Maniero
sorry n inform. t. hoursInicioCurso(TIME), t.toleranciaCurso(int). but if I try to put, for example: ADDTIME(t.hoursInicioCurso, '00:'+t.toleranciaCurso+':00) it adds seconds even so
– Grégori Sória