I'm trying some alternatives to show only the records of the last 30 days, but I could not make it work, the query I have looks like this:
SELECT comunidade.descricao AS nomeunidade
,comcargo.descricao AS nomecargo
,comcolaborador.nome
,date_format(comcolaborador.dtadmissao,'%d/%m/%Y') AS dataadm
,comcolaborador.foto
,comcolaborador.idcargo
,comcolaborador.idunidade
,comcolaborador.login
FROM comunidade
INNER JOIN comcolaborador
ON comunidade.idunidade = comcolaborador.idunidade
INNER JOIN comcargo
ON comcolaborador.idcargo = comcargo.idcargo
WHERE comcolaborador.ativo = 1
AND comcolaborador.dtadmissao >= '2016-08-01'
AND comunidade.ativo = 1
AND comcargo.ativo = 1
ORDER BY comcolaborador.dtadmissao DESC
And what I tried was this, following some tips and suggestions:
WHERE data >= dateadd(minute,-30,getdate())