What is wrong with this query please?

What is wrong with this query please?

Trying to get a report of the time taken for 1st response to a user which isn't system generated.
I've created the detail report for a month , but all I really want are the Min, Max and average values, so I've wrapped the detail select to make it a sub query but then it has all gone wrong - Syntax error at )

Anyone suggest what I should have done please.

Select Min(FNH) as 'Min', MAX(FNH) as 'Max', AVG(FNH) as 'Average' from (SELECT DISTINCT
NWO.WORKORDERID as 'Request ID', DATEDIFF(hh, DATEADD(s, WO.CREATEDTIME / 1000, '1970-01-01 00:00:00'), MIN(DATEADD(s, NOTI.NOTIFICATIONDATE / 1000,
'1970-01-01 00:00:00'))) AS 'FNH'
FROM Notify_WorkOrder AS NWO INNER JOIN
Notification AS NOTI ON NWO.NOTIFICATIONID = NOTI.NOTIFICATIONID INNER JOIN
WorkOrder AS WO ON WO.WORKORDERID = NWO.WORKORDERID
WHERE (NOTI.SENDERID <> 1) and WO.CREATEDTIME >= <from_lastmonth> and WO.CREATEDTIME <= <to_lastmonth> GROUP BY NWO.WORKORDERID, WO.CREATEDTIME
)









Thanks,
Andy






                  New to ADSelfService Plus?