Tested in Build PGSQL (14300) or MSSQL (14306)
This report contains the time analysis for each status/group/technician changes in a request, kindly execute this under Reports->New Query Report.
Status Changes:
SELECT wo.WORKORDERID AS "Request ID", sisd.STATUSNAME as "Changed From",sinsd.STATUSNAME as "Changed To",longtodate(si.ENDTIME) as "Changed Time",si.TIMESPENT as "TimeSpent in Previous Status(min)" FROM WorkOrder wo
LEFT JOIN WO_Assessment woas ON wo.WORKORDERID = woas.WORKORDERID
LEFT JOIN WO_Status_Info si ON woas.ASSESSMENTID = si.ASSESSMENTID
LEFT JOIN StatusDefinition sisd ON si.STATUSID = sisd.STATUSID
LEFT JOIN StatusDefinition sinsd ON si.NEXTSTATUSID = sinsd.STATUSID
WHERE
(
wo.ISPARENT = '1'
and si.NEXTSTATUSID IS Not Null
and wo.createdtime>=<from_thismonth>and wo.createdtime<=<to_thismonth>
)
ORDER BY
1,
woas.ASSESSMENTID asc
Group Changes:
SELECT wo.WORKORDERID AS "Request ID", q.queuename as "Changed From",qq.queuename as "Changed To",longtodate(woq.ENDTIME) as "Changed Time",woq.TIMESPENT as "TimeSpent by Previous Group(min)" FROM WorkOrder wo
LEFT JOIN WO_Assessment woas ON wo.WORKORDERID = woas.WORKORDERID
LEFT JOIN WO_group_Info woq ON woas.ASSESSMENTID = woq.ASSESSMENTID
LEFT JOIN queuedefinition q ON woq.GROUPID = q.QUEUEID
LEFT JOIN queuedefinition qq ON woq.NEXTGROUPID = qq.QUEUEID
WHERE
(
wo.ISPARENT = '1'
and woq.NEXTGROUPID IS Not Null
and wo.createdtime>=<from_thismonth>and wo.createdtime<=<to_thismonth>
)
ORDER BY
1,
woas.ASSESSMENTID asc
Technician Changes:
SELECT wo.WORKORDERID AS "Request ID", a.first_name as "Changed From",aa.first_name as "Changed To",longtodate(wot.ENDTIME) as "Changed Time",wot.TIMESPENT as "TimeSpent by Previous Technician(min)" FROM WorkOrder wo
LEFT JOIN WO_Assessment woas ON wo.WORKORDERID = woas.WORKORDERID
LEFT JOIN WO_Tech_Info wot ON woas.ASSESSMENTID = wot.ASSESSMENTID
LEFT JOIN AAAUser a ON wot.TECHNICIANID = a.USER_ID
LEFT JOIN AAAUser aa ON wot.NEXTTECHNICIANID = aa.USER_ID
WHERE
(
wo.ISPARENT = '1'
and wot.NEXTTECHNICIANID IS Not Null
and wo.createdtime>=<from_thismonth>and wo.createdtime<=<to_thismonth>
)
ORDER BY
1,
woas.ASSESSMENTID asc
How to compare date column with auto filled date templates?
- Here is the example for getting this week data - CREATEDTIME >= <from_thisweek> AND CREATEDTIME <= <to_thisweek>
- <from_thisweek> - Starting date of this week
- <to_thisweek> - Ending date of this week
- Available Date Templates
- Today - <from_today> - <to_today>
- This week - <from_thisweek> - <to_thisweek>
- Last week - <from_lastweek> - <to_lastweek>
- This month - <from_thismonth> - <to_thismonth>
- Last month - <from_lastmonth> - <to_lastmonth>
- This quarter - <from_thisquarter> - <to_thisquarter>
- Last quarter - <from_lastquarter> - <to_lastquarter>
- Yesterday - <from_yesterday> - <to_yesterday>