Erro: -420 Database Error

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 ') and turmas.ispublished=1 and turmas.inactive=0
and date(now())<=date(turma' at line 22

Statement:
select
pages.alias, pages.title,
turmas.id,
turmas.id as courseid,
turmas.pageid,
turmas.title,
turmas.datestart,
turmas.dateend,
turmas.city,
turmas.state,
turmas.statusid,
turmas.authorid,
modulo.title as modulotitle,
day(turmas.datestart) as modulo1daystart,
day(turmas.dateend) as modulo1dayend, month(turmas.datestart) as modulo1startmonth, month(turmas.dateend) as modulo1endmonth,year(turmas.dateend) as modulo1year,
turmas.*
from courses
inner join courses as modulo on courses.id=modulo.parentid
inner join courses as turmas on turmas.parentid=modulo.id
left join pages on pages.id=modulo.pageid
where 1
and (modulo.parentid=) and turmas.ispublished=1 and turmas.inactive=0
and date(now())<=date(turmas.datestart)
group by turmas.id
order by turmas.datestart

limit 0,10