→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Null
Engaged Sweeper II
I have created a simple report that would show us a simple overview (Agent, Requester, subject, and description of all tickets), opened and closed in the last 24 hours.

The report I have so far

Select Top 1000000 htblticket.date As [Date Created],
htblticket.agentid As Agent,
htblticket.fromuserid As Requester,
htblticket.subject As Subject,
htblnotes.note As Description
From htblticket
Inner Join htblnotes On htblticket.ticketid = htblnotes.ticketid
Where htblticket.ticketstateid = 2 And DateDiff(minute, htblticket.date,
Current_TimeStamp) <= 1440


an example of the output would look like;

Date Created: 11/15/2016 14:44:4
Agent: 16
Requester: 32
Subject: Test Subject
Description: Test description



What is the best way to get Agent 16 to show up as John Agent and Requester 32 to show up as Jane Requster?

Also, currently I have htblticket.ticketstateid = 2 which only shows tickets that are open. How can I get it to show closed tickets as well?
2 REPLIES 2
Niko0
Engaged Sweeper III
Shows both closed and opened tickets, Shows the name of the agent and requester instead of the id.

Select Top 1000000 htblticket.date As [Date Created],
htblusers1.name As Agent,
htblusers.name As Requester,
htblticket.subject As Subject,
htblnotes.note As Description
From htblticket
Inner Join htblnotes On htblticket.ticketid = htblnotes.ticketid
Inner Join htblusers On htblusers.userid = htblticket.fromuserid
Inner Join htblticketstates On htblticketstates.ticketstateid =
htblticket.ticketstateid
Inner Join htblagents On htblagents.agentid = htblticket.agentid
Inner Join htblusers htblusers1 On htblusers1.userid = htblagents.userid And
htblusers.userid = htblnotes.userid
Where DateDiff(minute, htblticket.date, Current_TimeStamp) <= 1440
Null
Engaged Sweeper II
I've seem to have the Agent name working now. I can't seem to find a way to add the requester name in there. Would htblticket.clientconcerning be the value of the person requesting the help? If so, where does this link up for the actual name of the person that is typed in and not the id?