I have this query:
where: {
$or: {
$and: {
mes: mes,
any: any
},
$and: {
dia: 1,
mes: 1 + Number(mes),
any: any
}
}
}
I try to select the records of a month and year, plus the first day of the following month. Everything seems correct. There is no compilation error, but in execution it does give an error like syntax: syntax error near ",".
Would anyone know why?
Update
The query I want to pass to Sequelize is the following:
WHERE ('Partes'.'mes'=3 AND 'Partes'.'anio'=2017
OR 'Partes'.'dia'=1 AND 'Partes'.'mes'=4 AND 'Partes'.'anio'=2017)
ORDER BY 'fecha' ASC, 'Comments'.'codigo' ASC;
Thank you.