Status
select woa.workorderid "RequestID",
sd1.statusname "From status",
sd2.statusname "To status",
longtodate(wsi.timespent) "Time Spent" from workorder wo
left join wo_assessment woa on wo.workorderid=woa.workorderid
inner join wo_status_info wsi on woa.assessmentid=wsi.assessmentid
left join statusdefinition sd1 on wsi.statusid=sd1.statusid
left join statusdefinition sd2 on wsi.nextstatusid=sd2.statusid order by 1