Help with SQL console Query

Moderator: crythias

Locked
iclaude
Znuny advanced
Posts: 117
Joined: 31 Mar 2016, 10:30
Znuny Version: OTRS 6.0.30
Real Name: Claude Chelene

Help with SQL console Query

Post by iclaude »

Hi,

I need some help to create a query to show
Duration of a Ticket in one Queue and sort by specific Date Interval.

Per example: if i wanted to know durantion of tickets created Yesterdey in My Queues .

Any Ideias?

Im using the following query:

SELECT ticket.tn, ticket.title, ticket_history.name, ticket_history_type.name, ticket_history.create_time
FROM `ticket`
LEFT JOIN ticket_history ON ticket_history.ticket_id = ticket.id
LEFT JOIN ticket_history_type ON ticket_history.history_type_id = ticket_history_type.id
WHERE ticket_history_type.name = "Move"
OR ticket_history_type.name = "NewTicket"
OR (
ticket_history_type.name = "StateUpdate"
AND (
ticket_history.name LIKE '%closed successful\%\%'
OR ticket_history.name LIKE '%closed unsuccessful\%\%'
)
)
ORDER BY ticket.tn
OTRS 6
Locked