
That aint always the close time. For example, we do some customer care after the ticket is closed, so we have some notes on tickets after closing them. With your method, you always select the first and last history row... just take care :)
-----Original Message-----
From: otrs-bounces@otrs.org [mailto:otrs-bounces@otrs.org] On Behalf Of sharif islam
Sent: quarta-feira, 13 de Julho de 2005 16:48
To: User questions and discussions about OTRS.org
Subject: Re: [otrs] Ticket Age data
On 7/13/05, sharif islam
On 7/12/05, duarte.cordeiro@cm-lisboa.pt
wrote: you'll need to look at ticket_history. But search for all the rows that havfe that same ticket_id. After that, you just need to find the create action and the close... and do the math.
[...]
| ticket_id | create_time | change_time | 1444 | 2004-11-19 10:06:07 | 2004-11-19 10:06:07 | | 1444 | 2004-11-19 10:06:07 | 2004-11-19 10:06:07 | | 1444 | 2004-11-19 10:06:07 | 2004-11-19 10:06:07 | | 1444 | 2004-11-19 10:44:15 | 2004-11-19 10:44:15 | | 1444 | 2004-11-19 10:44:15 | 2004-11-19 10:44:15 | | 1444 | 2004-11-19 10:46:06 | 2004-11-19 10:46:06 | | 1444 | 2004-11-19 10:46:06 | 2004-11-19 10:46:06 | | 1444 | 2004-11-19 10:46:06 | 2004-11-19 10:46:06 | | 1444 | 2004-11-19 10:46:06 | 2004-11-19 10:46:06
ok, how about this? mysql> select max(change_time),min(create_time),datediff(max(change_time),min(create_time)) from ticket_history where ticket_id=1444; +---------------------+---------------------+---------------------------------------------+ | max(change_time) | min(create_time) | datediff(max(change_time),min(create_time)) | +---------------------+---------------------+---------------------------------------------+ | 2004-11-19 10:46:06 | 2004-11-16 16:38:14 | 3 | +---------------------+---------------------+---------------------------------------------+ _______________________________________________ OTRS mailing list: otrs - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/otrs To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs Support oder Consulting fr Ihr OTRS System? => http://www.otrs.de/