Quantcast
Channel: Support Portal
Viewing all articles
Browse latest Browse all 20315

SQL Query to know when has been established Priority in a ticket

$
0
0
Hi!

I'm trying to prepare a SQL query (I'm using Microsoft SQL Server, not MySQL) to know the time when the priority of a ticket has been updated (from 0 to any other number) for the first time, and I'd like to see if that time when has been established the priority, is more than 2 hours from the Creationtime of the ticket.

I've found in the table WorkOrderHistory the OPERATIONTIME of all the history records of a ticket, and looking the HISTORYID in the table WorkOrderHistoryDiff I can see when the records when PRITORITYID changed the PREV_VALUE from NULL to 5 (for example) in CURRENT_VALUE.

I'd like to obtain the amount of tickets that have overpassed 2 ours from the creation time to the first time that priority has been updated, per group of technician in the last month.

I see the data is there, but i don't know how to query these different tables to have the result i want.

Any help will be appreciated.

Thanks!

Viewing all articles
Browse latest Browse all 20315

Trending Articles