MSSQL script needs assistance please

MSSQL script needs assistance please

I have a mssql script then when run on the sql server against the manage engine tables produces the results that I require, ie the top ten callers for the period specified.
 
When I try running this directly in ManageEngine I get query errors returning, can someone please take a look at the query and advise what needs to be in place to run the query in ManageEngine please.
 

SELECT top 10 aau.FIRST_NAME "Requester",max(dpt.DEPTNAME) "Department", count(aau.FIRST_NAME)

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 DepartmentDefinition dpt ON wo.DEPTID=dpt.DEPTID

WHERE  (((wo.CREATEDTIME >= dbo.unix_timestamp('2010-09-01')*1000) AND ((wo.CREATEDTIME != 0) AND (wo.CREATEDTIME IS NOT NULL))) AND ((wo.CREATEDTIME < dbo.unix_timestamp('2010-10-01')*1000) AND (((wo.CREATEDTIME != 0) AND (wo.CREATEDTIME IS NOT NULL)) AND (wo.CREATEDTIME != -1))))  AND wot.THD_WOID=wot.WORKORDERID

and aau.FIRST_NAME <> 'helpdesk'

group by aau.FIRST_NAME

ORDER BY count(aau.FIRST_NAME) desc

                  New to ADSelfService Plus?