RT Report

http://www.bestpractical.com/rt/

—Eva
SELECT * FROM tickets N
WHERE EXISTS
(SELECT * FROM TRANSACTIONS T
WHERE T.objectid = N.ID
and t.newvalue IN (‘closed’,’resolved’,’922′) or t.field <> ‘Queue’)
and N.queue = 81
and N.CREATED >= ’01-JAN-2014′;

—Level1
SELECT * FROM tickets N
WHERE EXISTS
(SELECT * FROM TRANSACTIONS T
WHERE T.objectid = N.ID
and t.newvalue IN (‘closed’,’resolved’)
and t.field <> ‘Queue’)
and n.queue = 81
and N.CREATED >= ’01-JAN-2014′

–Level1-Level2
SELECT * FROM tickets N
WHERE EXISTS
(SELECT * FROM TRANSACTIONS T
WHERE T.objectid = N.ID
and ( t.newvalue IN (‘closed’,’resolved’,’81’,’82’) or t.oldvalue IN (’81’,’82’))
and t.field IN (‘Status’,’Queue’))
and N.queue in (81,82)
and N.CREATED >= ’01-JAN-2014′;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.