I have set the HD up this way and need to run the report from this site.
https://www.lansweeper.com/forum/yaf_postst16360_Helpdesk-report---subcategory.aspx#post55047
But I want to add each ticket reason beneath, not just one, so I thought this would work but it did not, how can I add the next category.
Reason for ticket>
Hardware Related
Software Related
ETC.
I can get it if just the hardware related is there, but when I try to add software related, it shows no results.
Any advice please.
Select Distinct Top 1000000 htblticket.ticketid,
'#' + Cast(htblticket.ticketid As nvarchar) As Ticket,
htblticket.date,
htbltickettypes.typename,
htblticketstates.statename,
htblticket.subject,
htblusers1.name As [User Name],
htblusers.name As [Help Desk Agent Name],
Reasonforticket.data As [Reason for ticket],
HardwareRelated.data As [Hardware Related],
SoftwareRelated.data As [Software Related]
From htblticket
Left Join htblagents On htblagents.agentid = htblticket.agentid
Left Join htblusers On htblusers.userid = htblagents.userid
Inner Join htblusers htblusers1 On htblusers1.userid = htblticket.fromuserid
Left Join htblticketstates On htblticketstates.ticketstateid =
htblticket.ticketstateid
Inner Join htbltickettypes On htbltickettypes.tickettypeid =
htblticket.tickettypeid
Inner Join (Select Top 1000000 htblticketcustomfield.ticketid,
htblticketcustomfield.data
From htblticketcustomfield
Inner Join htblcustomfields On htblcustomfields.fieldid =
htblticketcustomfield.fieldid
Where htblcustomfields.name Like 'Reason For Ticket') As Reasonforticket
On htblticket.ticketid = Reasonforticket.ticketid
Inner Join (Select Top 1000000 htblticketcustomfield.ticketid,
htblticketcustomfield.data
From htblticketcustomfield
Inner Join htblcustomfields On htblcustomfields.fieldid =
htblticketcustomfield.fieldid
Where htblcustomfields.name Like 'Hardware Related') As HardwareRelated On
htblticket.ticketid = HardwareRelated.ticketid
Inner Join (Select Top 1000000 htblticketcustomfield.ticketid,
htblticketcustomfield.data
From htblticketcustomfield
Inner Join htblcustomfields On htblcustomfields.fieldid =
htblticketcustomfield.fieldid
Where htblcustomfields.name Like 'Software Related') As SoftwareRelated On
htblticket.ticketid = SoftwareRelated.ticketid