qd1.QUEUENAME "From Group",
qd2.QUEUENAME "To Group",
cast((wog.timespent/60) as varchar(20)) +':'+cast((wog.timespent % 60) as varchar(20)) "Time Spent (hrs)" from workorder wo
left join wo_assessment woa on wo.workorderid=woa.workorderid
inner join WO_GROUP_INFO wog on woa.assessmentid=wog.assessmentid
LEFT JOIN QueueDefinition qd1 ON wog.groupid=qd1.QUEUEID
LEFT JOIN QueueDefinition qd2 ON wog.nextgroupid=qd2.QUEUEID where wo.CREATEDTIME >= <from_yesterday> AND wo.CREATEDTIME <= <to_yesterday> order by 1
Now we need customized report as,| Ticket ID | Request type | Created Time | Group1 | Time Spent | Group2 | Time Spent | Total time spent |