Accounted time report creation

English! place to talk about development, programming and coding
Post Reply
sbhull
Znuny newbie
Posts: 1
Joined: 04 Nov 2011, 08:00
Znuny Version: 3.0.4
Real Name: Sukhjinder Bhullar
Company: Sapient Corporation

Accounted time report creation

Post by sbhull »

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
earwax
Znuny newbie
Posts: 43
Joined: 07 Dec 2010, 23:54
Znuny Version: 3.0.11
Location: Seattle, WA
Contact:

Re: Accounted time report creation

Post by earwax »

OTRS 3.0.12
Ubuntu Linux 10.04
MySQL
tonyt42
Znuny newbie
Posts: 1
Joined: 14 Feb 2012, 18:22
Znuny Version: 4
Real Name: Tony Tellez

Re: Accounted time report creation

Post by tonyt42 »

Thank you sir.
Post Reply