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 Report creation based on FilePathFull for Installation
by  Pang  
Go to last post Go to first unread
Last post: Yesterday at 2:50:23 PM(UTC)
Lansweeper Software Version Compatibility Report (Solved)
by  RC62N   Go to last post Go to first unread
Last post: 7/13/2020 5:04:10 PM(UTC)
Lansweeper Reports Email Question
by  muffintopman  
Go to last post Go to first unread
Last post: 7/13/2020 3:23:23 PM(UTC)
Lansweeper Ripple20
by  Hendrik.VE  
Go to last post Go to first unread
Last post: 7/8/2020 8:09:35 AM(UTC)
Lansweeper All USB devices connected
by  earmor   Go to last post Go to first unread
Last post: 7/7/2020 1:35:37 PM(UTC)
Lansweeper Software audit with installation date
by  RC62N  
Go to last post Go to first unread
Last post: 7/3/2020 3:39:41 PM(UTC)