Query to get Request Apporval details

Query to get Request Apporval details

Version : 14001
DB : MSSQL / PGSQL

OUTPUT :





SELECT wo.WORKORDERID AS "Request ID",
wo.title AS "Subject",
wo.REQUESTERID AS "Requester ID",
LONGTODATE(wo.CREATEDTIME) AS "Requested Date",
LONGTODATE(apdet.sent_time) AS "Action Performed Date",
au.FIRST_NAME AS "APPROVEDBY",
apdet.STATUSID,
appStDef.STATUSNAME AS "Approval Status" FROM WorkOrder wo
LEFT JOIN WorkOrderStates wos ON wo.WORKORDERID=wos.WORKORDERID
LEFT JOIN ApprovalStatusDefinition appStDef ON wos.APPR_STATUSID=appStDef.STATUSID
LEFT JOIN request_approvallevel req_ap ON wo.WORKORDERID=req_ap.entityid
LEFT JOIN approvallevel aplev ON req_ap.levelid=aplev.id
LEFT JOIN approvaldetails apdet ON aplev.id=apdet.approval_level_id
LEFT Join SdUser sd on apdet.APPROVEDBY = sd.USERID
Left Join AaaUser au on sd.USERID=au.USER_ID WHERE (wo.ISPARENT='1')

                  New to ADSelfService Plus?