Skip to content

Instantly share code, notes, and snippets.

@renatoschroepfer
Last active July 12, 2017 00:28
Show Gist options
  • Save renatoschroepfer/d5b46ee72981f5e9bd32f60bfed8412b to your computer and use it in GitHub Desktop.
Save renatoschroepfer/d5b46ee72981f5e9bd32f60bfed8412b to your computer and use it in GitHub Desktop.
SELECT
vencido.tickets_id,
Tickets.name,
Tickets.due_date,
Tickets.solvedate,
Cat.completename,
TIMESTAMPDIFF(hour, Tickets.date, Tickets.solvedate) as Tempo
FROM
glpi_vencidos as vencido
INNER JOIN
glpi_tickets as Tickets
ON (Tickets.id = vencido.tickets_id)
INNER JOIN
glpi_itilcategories as Cat
ON (Tickets.itilcategories_id = Cat.id)
WHERE
Tickets.solvedate between STR_TO_DATE('01/06/2017', '%d/%m/%Y') and STR_TO_DATE('01/07/2017', '%d/%m/%Y')
and vencido.situacao = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment