Hi Folks -
I have a query that returns all of my pending requests as long as Technician, emailid, request type are filled out. However, there are times people submit tickets by email, therefore, the Request Type isn't filled out.
Can you help me adjust this query to return all Open requests where the technician is assigned, the request type is null and the status is open?
Here is my query and I added the "Open" part at the end...Thanks!!
SELECT wo.WORKORDERID "requestid",
wo.TITLE "subject",
std.STATUSNAME "status",
ti.FIRST_NAME "technician",
au.FIRST_NAME "requester",
org.NAME "site",
aci.EMAILID "email" FROM WorkOrder wo
LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID
LEFT JOIN SDUser td ON wos.OWNERID=td.USERID
LEFT JOIN AaaUser ti ON td.USERID=ti.USER_ID
LEFT JOIN StatusDefinition std ON wos.STATUSID=std.STATUSID
LEFT JOIN AaaUserContactInfo auci ON ti.user_id=auci.user_id
LEFT JOIN AaaContactInfo aci ON auci.contactinfo_id=aci.contactinfo_id
LEFT JOIN AaaUser au on wo.requesterid=au.user_id
LEFT JOIN SiteDefinition sd on wo.siteid=sd.siteid
LEFT JOIN SdOrganization org on sd.siteid=org.org_id
WHERE (wo.ISPARENT='1') and std.ISPENDING='1' and wos.OWNERID!=0 and aci.emailid !='' and std.STATUSID='1'
order by wo.WORKORDERID