Error in query dates and collations charset - illegal mix of collations

0

Hi, I have the following problem:

I have all my MySQL DB, tables and columns with charset utf8 and collation utf8_spanish_ci

When I run this query:

SELECT * 
FROM profesionales INNER JOIN horarios
ON profesionales.id = horarios.idProfesional
WHERE horarios.idDia = 3
AND horarios.desde <= '09:00:00'
AND '09:00:00' <= (TIMEDIFF(horarios.hasta, '01:00:00'))
GROUP BY horarios.id

returns the following error:

Error Code: 1267. Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation '<='

I'm thinking that it may be the way I have my hours (schedules.from and schedules.to they are of type TIME, in MySQL) and the one that happened to me and returns the function TIMEDIFF() , I do not know if is with single or double quotes, or without the seconds, or I do not know ...

    
asked by GADGustavo67 30.10.2018 в 22:14
source

0 answers