/build/static/layout/Breadcrumb_cap_w.png

K1000 report: Working Hours per week per person

This report is made to know how many hours has worked each one on the current week, so it is personally. there is one report for everyone in support department. it is easy, you just have to change de USER.ID.
This report calculate the hours worked from Monday to Friday of this week.

select U.FULL_NAME AS ATENDENTE, HD_QUEUE.NAME AS FILA,

SUM(format(time_to_sec(timediff(HD_WORK.STOP,HD_WORK.START))/ 3600.0 + HD_WORK.ADJUSTMENT_HOURS,2)) AS 'Horas trabalhadas',
curdate() as Semana,
date_sub(curdate(),INTERVAL (dayofweek(curdate())- 2) day) as Segunda,
date_add(date_sub(curdate(),INTERVAL (dayofweek(curdate())- 2) day), INTERVAL 4 day) as Sexta

from HD_TICKET

LEFT JOIN USER U ON (HD_TICKET.OWNER_ID = U.ID)
left join HD_WORK ON (HD_TICKET.ID = HD_WORK.HD_TICKET_ID)
left join HD_QUEUE ON (HD_TICKET.HD_QUEUE_ID = HD_QUEUE.ID),
    
 (select date_sub(curdate(),INTERVAL (dayofweek(curdate())- 2) day) as LUNES,
       date_add(date_sub(curdate(),INTERVAL (dayofweek(curdate())- 2) day), INTERVAL 4 day) as VIERNES FROM DUAL) H
WHERE U.ID = 29 and
HD_TICKET.OWNER_ID = U.ID and
HD_TICKET.ID = HD_WORK.HD_TICKET_ID and
HD_TICKET.MODIFIED between H.LUNES and H.VIERNES 

GROUP BY ATENDENTE

Comments

This post is locked
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ