Query to get Request list based on created time grouped by
Version : 13000
DB : PGSQL
OUTPUT:
SELECT wo.WORKORDERID AS "Request ID", longtodate(wo.CREATEDTIME) AS "Created Time", aau.FIRST_NAME AS "Requester", longtodate(wo.COMPLETEDTIME) AS "Closed On", ad.ORG_NAME AS "Account", rtl.TEMPLATENAME AS "Template Name", longtodate(wos.ASSIGNEDTIME) AS "Assigned Time", ti.FIRST_NAME AS "Assigned To" FROM WorkOrder wo LEFT JOIN WorkOrderAccountMapping wam ON wo.WORKORDERID=wam.WORKORDERID LEFT JOIN PortalAccounts port_acc ON wam.ACCOUNTID=port_acc.ACCOUNTID LEFT JOIN AccountDefinition ad ON port_acc.ACCOUNTID=ad.ORG_ID LEFT JOIN SDUser sdu ON wo.REQUESTERID=sdu.USERID LEFT JOIN AaaUser aau ON sdu.USERID=aau.USER_ID 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 RequestTemplate_List rtl ON wo.TEMPLATEID=rtl.TEMPLATEID WHERE (wo.ISPARENT='1') and wo.CREATEDTIME >= <from_lastmonth> and wo.CREATEDTIME <= <to_lastmonth> order by wo.CREATEDTIME
New to ADSelfService Plus?