Notification

Icon
Error

not taking second condition - I have a query that is working fine to a point, once i place a second or statement in the query the

Posted: Friday, October 25, 2019 9:11:13 PM(UTC)
JKnapik

JKnapik

Member Original PosterPosts: 3
0
Like
Select Top 1000000 htblticket.ticketid,
'#' + Cast(htblticket.ticketid As nvarchar) As Ticket,
htblusers1.name As AssignedAgent,
htblticket.date As CreationDate,
htblticket.updated As LastUpdated,
'../helpdesk/icons/' + htbltickettypes.icon As icon
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 (htblticket.updated < GetDate() - 3 And htbltickettypes.typename <>
'Employee Seperation') Or
(htbltickettypes.typename <> 'project')
Order By htblticket.ticketid
JKnapik
#1JKnapik Member Original PosterPosts: 3  
posted: 10/28/2019 4:45:22 PM(UTC)
how can i get the report to exclude both project and employee separation from the result

Select Top 1000000 htblticket.ticketid,
'#' + Cast(htblticket.ticketid As nvarchar) As Ticket,
htblusers1.name As AssignedAgent,
htblticket.date As CreationDate,
htblticket.updated As LastUpdated,
'../helpdesk/icons/' + htbltickettypes.icon As icon
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 (htblticket.updated < GetDate() - 3 And htbltickettypes.typename <>
'Employee Seperation') Or
(htbltickettypes.typename <> 'project')
Order By htblticket.ticketid

Active Discussions

Lansweeper Software List by Computer/Server Name
by  Andy.S  
Go to last post Go to first unread
Last post: Yesterday at 8:06:43 AM(UTC)
Lansweeper Asset: Duplicate Serial Number (Built-in)
by  brodiemac-too   Go to last post Go to first unread
Last post: 8/5/2020 1:28:56 PM(UTC)
Lansweeper A Simple Report (or so I thought)
by  Andy.S  
Go to last post Go to first unread
Last post: 8/5/2020 11:30:45 AM(UTC)
Lansweeper Paid Report Writer Service
by  endyk   Go to last post Go to first unread
Last post: 8/4/2020 11:56:20 AM(UTC)
Lansweeper Multiple Computers per User
by  brodiemac-too  
Go to last post Go to first unread
Last post: 7/30/2020 12:43:38 PM(UTC)
Lansweeper Workstations with No AV
by  brodiemac-too   Go to last post Go to first unread
Last post: 7/29/2020 7:44:53 PM(UTC)
Lansweeper AV Audit Report
by  RC62N  
Go to last post Go to first unread
Last post: 7/29/2020 5:17:42 PM(UTC)