‎05-04-2017 09:06 PM
Select Top 1000000 htblticket.ticketid As ID,
htblticket.subject As Subject,
htblticket.date As [Creation Date],
htblticketstates.statename As Status,
htbltickettypes.typename As Type,
htblsource.name As Source,
htblusers.name As [User],
htblusers1.name As Agent,
htblsource.icon As icon,
DateDiff(day, htblticket.date, GetDate()) As [Days Since Creation]
From htblticket
Inner Join htblpriorities On htblpriorities.priority = htblticket.priority
Inner Join htblticketstates On htblticketstates.ticketstateid =
htblticket.ticketstateid
Inner Join htblusers On htblusers.userid = htblticket.fromuserid
Left Join htblagents On htblagents.agentid = htblticket.agentid
Left Join htblusers htblusers1 On htblusers1.userid = htblagents.userid
Inner Join htbltickettypes On htblticket.tickettypeid =
htbltickettypes.tickettypeid
Inner Join htblsource On htblticket.sourceid = htblsource.sourceid
Inner Join htblusers htblusers2 On htblticket.userid_lastnote =
htblusers2.userid
Where (htblticketstates.statename = 'Open') Or
(htblticketstates.statename = 'In Progress') Or
(htblticketstates.statename = 'Awaiting Reply')
Order By Agent,
[Days Since Creation] Desc
‎05-26-2017 04:13 PM
‎05-05-2017 04:32 PM
Select Top 1000000 htblticket.ticketid As ID,
htblticket.subject As Subject,
htblticket.date As [Creation Date],
htblticketstates.statename As Status,
htbltickettypes.typename As Type,
htblsource.name As Source,
htblusers.name As [User],
htblusers1.name As Agent,
htblsource.icon As icon,
DateDiff(day, htblticket.date, GetDate()) As [Days Since Creation]
From htblticket
Inner Join htblpriorities On htblpriorities.priority = htblticket.priority
Inner Join htblticketstates On htblticketstates.ticketstateid =
htblticket.ticketstateid
Inner Join htblusers On htblusers.userid = htblticket.fromuserid
Left Join htblagents On htblagents.agentid = htblticket.agentid
Left Join htblusers htblusers1 On htblusers1.userid = htblagents.userid
Inner Join htbltickettypes On htblticket.tickettypeid =
htbltickettypes.tickettypeid
Inner Join htblsource On htblticket.sourceid = htblsource.sourceid
Inner Join htblusers htblusers2 On htblticket.userid_lastnote =
htblusers2.userid
Where (htblticketstates.statename = 'Open' Or htblticketstates.statename =
'In Progress' Or htblticketstates.statename = 'Awaiting Reply') And
htbltickettypes.typename != 'Bug Tracker (Dev Only)'
Order By Agent,
[Days Since Creation] Desc
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now