Ticket report for open tickets in the last 12 month /NK
Tudo bem?
Estou procurando algo para filtrar um relatório de todos os chamados em aberto no kace, ou se possivel determinar por periodo sendo algo em torno de 12 meses... alguém teria alguma dica de como pode fazer esse relatório simples.
Obrigado,Bruno
Answers (5)
Hi Bruno,
most of the requirements are possible with the reporting wizard.
Please always communicate in English here, since only a small fraction of the users here are speaking Portugese.
For your help I translated the title, so anyone who wants to help knows the topic.
Top Answer
Tenta isso daqui brother:
SELECT T.TITLE AS "TITULO",T.SUMMARY AS "DESCRIÇÃO",
T.CREATED AS "CRIADO EM",
P.NAME AS "PRIORIDADE",
U.FULL_NAME AS "PROPRIETÁRIO",
UU.FULL_NAME AS "EMISSOR",
S.NAME AS "STATUS",
Q.NAME AS "FILA",
C.NAME AS "CATEGORIA"
FROM HD_TICKET T
LEFT JOIN HD_PRIORITY P
ON P.ID = T.HD_PRIORITY_ID
LEFT JOIN HD_STATUS S
ON S.ID = T.HD_STATUS_ID
LEFT JOIN HD_QUEUE Q
ON Q.ID = T.HD_QUEUE_ID
LEFT JOIN HD_CATEGORY C
ON C.ID = T.HD_CATEGORY_ID
LEFT JOIN USER U
ON U.ID = T.OWNER_ID
LEFT JOIN USER UU
ON UU.ID = T.SUBMITTER_ID
WHERE T.CREATED > NOW() - INTERVAL 12 MONTH /*MUDAR DATA AQUI*/
ORDER BY T.CREATED DESC
Try writing the question in English next time XD
Edit: or the select between two dates change the WHERE statement to:
WHERE T.CREATED BETWEEN '2021-01-01' AND '2021-12-31'
Good evening! I'm looking for exactly that but there's a way to filter by closed period.. I'm trying to adjust this Line..but I don't know much about SQL... it's giving an error
WHERE T.CREATED > NOW() - INTERVAL '2021-01-01' AND '2021-12-31'
thank you so much for helping
Comments:
-
Then this is the change that you want to make
WHERE T.CREATED BETWEEN '2021-01-01' AND '2021-12-31' /*MUDAR DATA AQUI*/
The NOW() function is to make the query relative to the time that it ran (so all tickets where the creation time is grater than right now minus 12 months). If you want to make a query based on an absolute time frame, you will need to use the BETWEEN operator to get a result... well, between two absolute dates.
I hope I could be of help! - IgorAngelini 2 years ago
It worked, thank you very much
Comments:
-
Glad I could help, I edited my first answer to include the solution that you wanted, If you want, mark it as correct to save the next person with this doubt from reading all the comments. - IgorAngelini 2 years ago