‎10-04-2016 09:24 PM
Solved! Go to Solution.
‎10-05-2016 11:25 AM
Select Top 1000000 htblticket.ticketid As ID,
htblticket.subject As Subject,
htblticket.date As [Creation Date],
htblpriorities.name As Priority,
htblticketstates.statename As Status,
htbltickettypes.typename As Type,
htblticket.slaname As SLA,
htblsource.name As Source,
htblusers.name As [User],
htblusers1.name As Agent,
htblusers2.name As [User Last Reply],
htblsource.icon As icon,
htblticket.updated As [Close Date],
htblticket.slainitial As [Initial Response Date Limit],
Case When Cast(htblticket.slaresolved As nvarchar) Like '%1900%' Then Null
Else htblticket.slaresolved End As [Resolve Date Limit]
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 = 'Closed' And DatePart(mm, htblticket.date) =
DatePart(mm, GetDate()) And DatePart(yy, htblticket.date) = DatePart(yy,
GetDate())
Order By ID
‎10-05-2016 11:25 AM
Select Top 1000000 htblticket.ticketid As ID,
htblticket.subject As Subject,
htblticket.date As [Creation Date],
htblpriorities.name As Priority,
htblticketstates.statename As Status,
htbltickettypes.typename As Type,
htblticket.slaname As SLA,
htblsource.name As Source,
htblusers.name As [User],
htblusers1.name As Agent,
htblusers2.name As [User Last Reply],
htblsource.icon As icon,
htblticket.updated As [Close Date],
htblticket.slainitial As [Initial Response Date Limit],
Case When Cast(htblticket.slaresolved As nvarchar) Like '%1900%' Then Null
Else htblticket.slaresolved End As [Resolve Date Limit]
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 = 'Closed' And DatePart(mm, htblticket.date) =
DatePart(mm, GetDate()) And DatePart(yy, htblticket.date) = DatePart(yy,
GetDate())
Order By ID
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now