I need to know which folios are duplicated within a date range, from a specific department, I have this query but I get some errors:
select n.numero, n.nombre from Empleado as n where n.Fecha = '2022-05-29 00:00:00.000' between n.Fecha = '2022-05-30 00:00:00.000'
and n.ID_departamento = '123'
group by numero,nombre having COUNT(*)>1
incorrect syntax near between
incorrect syntax near '*'. Specting '(' or SELECT
Also how can I remove those duplicates?