-
Report / SQL element / Date of selection
Hello,
I’ve created a report using a SQL element. I want to know how I can integrate the “date filter” in the Report view in this request ?
Is-there a special Tag to put in the SQL request to be able to use the date filter ?
In the following request, I want to change the line starting by “and FROM_UNIXTIME…” to use a “BETWEEN” using the filter dates.
eg :
select a.alias agent_name, FROM_UNIXTIME(min(c.utimestamp)) DateMin_Compil,FROM_UNIXTIME(max(c.utimestamp)) DateMax_Compil, count(*) occurence
from tagente_datos c, tagente_modulo b, tagente a
where
b.id_agente_modulo = c.id_agente_modulo
and a.id_agente = b.id_agente
and (b.nombre like “Resultat compil%”)
and a.nombre like “Compil.%”
and FROM_UNIXTIME(c.utimestamp) >= DATE_SUB(CURRENT_DATE(),INTERVAL 7 DAY)
and datos <> 2
group by c.id_agente_modulo, b.nombre,a.alias
order by occurence desc, alias;