Here is my sql query which works in SQL server.
DATEADD(hour,-QT.[SpecPeriod],AG.[START TIME]) ahStart
In places where Specperiod is null then th