I have two tables: col
(contributor) and Indicacao
.
I made select
to know how many leads each employee has. It is working but I can not filter by date using between
.
SELECT c.id, c.nome, funcao, area, count(p.cpf_cli) AS quantidade FROM
col c LEFT JOIN
indicacao p ON p.id_colaborador = c.id GROUP BY c.id, c.nome ORDER BY
c.nome
I tried with between
but it did not work.
SELECT c.id, c.nome, funcao, area, count(p.cpf_cli) AS quantidade FROM
col c LEFT JOIN
indicacao p ON p.id_colaborador = c.id GROUP BY c.id, c.nome ORDER BY
c.nome WHERE indicacao.data_ind BETWEEN '2018/09/20' AND '2018/09/21'