Report question - number of days and ordering.

Report question - number of days and ordering.

I have the current report:

SELECT ti.FIRST_NAME "Support Rep",wo.WORKORDERID "Request ID", std.STATUSNAME "Request Status",org.NAME "Account",aau.FIRST_NAME "Contact",wo.TITLE "Subject",cd.CATEGORYNAME "Category",longtodate(wo.CREATEDTIME) "Created Time",longtodate(wo.LASTUPDATED) "Last Updated" FROM WorkOrder_Threaded wot INNER JOIN WorkOrder wo ON wot.WORKORDERID=wo.WORKORDERID 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 CategoryDefinition cd ON wos.CATEGORYID=cd.CATEGORYID LEFT JOIN SDUser td ON wos.OWNERID=td.USERID LEFT JOIN AaaUser ti ON td.USERID=ti.USER_ID LEFT JOIN StatusDefinition std ON wos.STATUSID=std.STATUSID LEFT JOIN WorkOrder_Account woacc ON wo.WORKORDERID=woacc.WORKORDERID LEFT JOIN Customer cust ON woacc.ACCOUNTID=cust.CUSTOMER_ID LEFT JOIN AaaOrganization org ON cust.CUSTOMER_ID=org.ORG_ID WHERE  ((((std.STATUSNAME != 'Closed') OR ( std.STATUSNAME IS NULL)) AND ((std.STATUSNAME != 'Resolved') OR ( std.STATUSNAME IS NULL))) AND (wo.DEPARTMENTID = 1))  AND wot.THD_WOID=wot.WORKORDERID  ORDER BY 1, 3, 4, 8

I would like to add the number of days since the report was created and would like to order by support rep, days since created, then the other orders.   I am also using MYSQL as the db.

Thanks,
Shawn







                New to ADSelfService Plus?