georgesOne
Technical User
Dear All,
I have a query which produces the results I want, but it takes forever (ca. 25 secs on my pretty fast machine). Each line is repeated 15 times for data of different years:
I understand that it is a lot of data to crunch, but I wonder if there is a way to make it faster?
Any suggestion is welcome, goergesOne
I have a query which produces the results I want, but it takes forever (ca. 25 secs on my pretty fast machine). Each line is repeated 15 times for data of different years:
Code:
SELECT qryActNENK.PID,
Sum([CRev2015]/1.29) AS [WS-Rev-2015], (x15)
Sum([CRev2015]/1.29*CProb) AS [WS-Rev-RA-2015], (x15)
IIf(Sum([CRev2015])=0,0,Sum([CRev2015]/1.29*CProb)/Sum([CRev2015]/1.29)) AS [WS-RAdj-2015], (x15)
[WS-Rev-2015]/[WS-Lay-2015]/[WS-DV-2015]/[WS-P-2015]*1000000 AS [WS-WS-2015], (x15)
IIf(IsNull(Sum(WS2015)),Sum(Lay)/Count(Lay),Sum(Lay*WS2015)/Sum(WS2015)) AS [WS-Lay-2015], (x15)
IIf(IsNull(Sum(WS2015)),Sum(DV)/Count(DV),Sum(DV*WS2015)/Sum(WS2015)) AS [WS-DV-2015], (x15)
IIf(IsNull(Sum(WS2015)),Sum([P$L])/1.29/Count([P$L]),Sum([P$L]/1.29*WS2015)/Sum(WS2015)) AS [WS-P-2015] (x15)
FROM qryActNENK
WHERE NOT ISNULL(qryActNENK.PID)
GROUP BY qryActNENK.PID;
Any suggestion is welcome, goergesOne