diff --git a/SolarPower/Repository/Implement/OverviewRepository.cs b/SolarPower/Repository/Implement/OverviewRepository.cs index d9ecd60..2b34507 100644 --- a/SolarPower/Repository/Implement/OverviewRepository.cs +++ b/SolarPower/Repository/Implement/OverviewRepository.cs @@ -608,7 +608,7 @@ namespace SolarPower.Repository.Implement , (DENSE_RANK() OVER(ORDER BY C.TIMESTAMP)) - 1 AS PreROWID, C.TIMESTAMP,{kwh} AS KWH,C.SOLARHOUR,C.PR,P.Irradiance,P.Temperature AS Temp FROM {usedb} C - LEFT JOIN {pyrdb} P ON DATE_FORMAT(P.TIMESTAMP,'{timeGroup}') = DATE_FORMAT(C.TIMESTAMP,'{timeGroup}') + LEFT JOIN {pyrdb} P ON DATE_FORMAT(P.TIMESTAMP,'{timeGroup}') = DATE_FORMAT(C.TIMESTAMP,'{timeGroup}') AND P.PowerStationId = C.PowerStationId WHERE C.PowerStationId = {post.PowerstationId}{range2} GROUP BY C.TIMESTAMP ORDER BY C.TIMESTAMP ) A RIGHT OUTER JOIN @@ -617,7 +617,7 @@ namespace SolarPower.Repository.Implement , (DENSE_RANK() OVER(ORDER BY C.TIMESTAMP)) - 1 AS PreROWID, C.TIMESTAMP,{kwh} AS KWH,C.SOLARHOUR,C.PR,P.Irradiance,P.Temperature AS Temp FROM {usedb} C - LEFT JOIN {pyrdb} P ON DATE_FORMAT(P.TIMESTAMP,'{timeGroup}') = DATE_FORMAT(C.TIMESTAMP,'{timeGroup}') + LEFT JOIN {pyrdb} P ON DATE_FORMAT(P.TIMESTAMP,'{timeGroup}') = DATE_FORMAT(C.TIMESTAMP,'{timeGroup}') AND P.PowerStationId = C.PowerStationId WHERE C.PowerStationId = {post.PowerstationId}{range2} GROUP BY C.TIMESTAMP ORDER BY C.TIMESTAMP ) B ON A.ROWID = B.PreROWID