 CREATE VIEW VSpecIntHistory AS
     SELECT
         site.name AS ExecutingSite,
-        CAST(ROUND(IF((ServiceLevelType = 'HEPSPEC'),(ServiceLevel * 250),ServiceLevel),0) AS UNSIGNED) AS SpecInt2000,
+        CAST(ROUND(NormalisedWallDuration / WallDuration * 250, 0) AS UNSIGNED) AS SpecInt2000,
         CAST(SUM(NumberOfJobs) AS UNSIGNED) AS Njobs,
         Month,
         Year,
         CAST(MIN(EarliestEndTime) AS DATE) AS RecordStart,
         CAST(MAX(LatestEndTime) AS DATE) AS RecordEnd
     FROM
-        SuperSummaries JOIN Sites AS site ON SiteID = site.id
+        NormalisedSuperSummaries JOIN Sites AS site ON SiteID = site.id
     GROUP BY
         SiteID,
         SpecInt2000,

CREATE VIEW VHepSpecHistory AS
    SELECT
        site.name AS Site,
        ServiceLevel AS HepSpec06,
        SUM(NumberOfJobs) AS NumberOfJobs,
        Year,
        Month,

-- Extra views on NormalisedSuperSummaries for the central APEL server.
-- This schema does not need to be loaded by regional servers.

-- TODO Check if need conversion to hours (divide by 3600).

DROP VIEW IF EXISTS VSumCPU;
