Hi,
I am looking for SQL to generate report on accounted time " Time Units"
QueueWise accounted time for last 7 days. I have created this sql but it is not grouping queue's data together.
select (Select x.name from queue x where x.id =q.id) Queue_name,t.tn Ticket_number,t.create_time Create_time, sum(a.time_unit) "Accounted_Time", s.name "Ticket State"
from ticket t, ticket_state s, users u, time_accounting a , queue q
where t.ticket_state_id = s.id
and t.user_id = u.id
and t.id = a.ticket_id
and t.queue_id=q.id
and q.id IN (17,5,6,14,21,32)
and date_Format(t.create_time,'%Y')=date_Format(now(),'%Y')
and t.create_time between DATE_SUB(curdate(), INTERVAL 7 DAY)
and DATE_SUB(curdate(), INTERVAL 0 DAY)
group by a.ticket_id
Order by queue_name ;
can someone help me here?
Thanks,
Sukhjinder
Accounted time report creation
-
- Znuny newbie
- Posts: 43
- Joined: 07 Dec 2010, 23:54
- Znuny Version: 3.0.11
- Location: Seattle, WA
- Contact:
Re: Accounted time report creation
This post might help:
http://forums.otrs.org/viewtopic.php?f=60&t=12546
http://forums.otrs.org/viewtopic.php?f=60&t=12546
OTRS 3.0.12
Ubuntu Linux 10.04
MySQL
Ubuntu Linux 10.04
MySQL
Re: Accounted time report creation
Thank you sir.