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 HP Warranty scan - broken for some products
by  M Redfern   Go to last post Go to first unread
Last post: Today at 12:30:44 PM(UTC)
Lansweeper Worked time
by  Imrane DESSAI  
Go to last post Go to first unread
Last post: Today at 7:14:40 AM(UTC)
Lansweeper Adding Owner/User information to Assets:All column report
by  ssmarr5   Go to last post Go to first unread
Last post: Today at 12:15:01 AM(UTC)
Lansweeper Send users email about low disk space
by  DontByteMe  
Go to last post Go to first unread
Last post: Yesterday at 10:02:43 PM(UTC)
Lansweeper Can reports be directed to a file server
by  RKCar   Go to last post Go to first unread
Last post: Yesterday at 9:40:18 PM(UTC)
Lansweeper Monitor Model- Generic PnP Monitor
by  Roger D.  
Go to last post Go to first unread
Last post: Yesterday at 7:22:01 PM(UTC)
Lansweeper Are Deleted Dashboard Tabs Retrievable?
by  Rob-CD   Go to last post Go to first unread
Last post: Yesterday at 4:04:45 PM(UTC)
Lansweeper Assets Not Seen in 90 Days not Automatically becoming Inactive
by  Rob-CD  
Go to last post Go to first unread
Last post: Yesterday at 4:00:00 PM(UTC)