I
inungh
I have a following query to calculate base on previous query named [SP
RPT GET RRE CSI PRE]
The pre query some times does not have SumA or SumB which get errors
on this query, since there is no record for SumA and SumB.
Are there any workaround for this?
Your help is great appreciated,
SELECT EDA.EmployeeNO, [SP RPT GET RRE CSI PRE].SplitID, Round(Sum((IIf
(IsNull([SumA]),0,[SumA])+IIf(IsNull([SumB]),0,[SumB]))/(IIf(IsNull
([SumA]),0,[SumA])+IIf(IsNull([SumB]),0,[SumB])+IIf(IsNull([SumC]),0,
[SumC])+IIf(IsNull([SumD]),0,[SumD])))*100,2) AS CSI, Sum([SP RPT GET
RRE CSI PRE].SACD) AS ACD
FROM [SP RPT GET RRE CSI PRE] INNER JOIN (tblSplits INNER JOIN
(tblPIPEmployee AS Supervisors INNER JOIN (tblPIPEmployee AS EDA INNER
JOIN tblPIPEmployee ON EDA.Employee_ID = tblPIPEmployee.EDA) ON
Supervisors.Employee_ID = tblPIPEmployee.Supervisors) ON
(tblSplits.SplitID = tblPIPEmployee.GroupID) AND (tblSplits.DeptID =
tblPIPEmployee.DeptID)) ON [SP RPT GET RRE CSI PRE].EmployeeNO =
tblPIPEmployee.EmployeeNO
GROUP BY EDA.EmployeeNO, [SP RPT GET RRE CSI PRE].SplitID;
RPT GET RRE CSI PRE]
The pre query some times does not have SumA or SumB which get errors
on this query, since there is no record for SumA and SumB.
Are there any workaround for this?
Your help is great appreciated,
SELECT EDA.EmployeeNO, [SP RPT GET RRE CSI PRE].SplitID, Round(Sum((IIf
(IsNull([SumA]),0,[SumA])+IIf(IsNull([SumB]),0,[SumB]))/(IIf(IsNull
([SumA]),0,[SumA])+IIf(IsNull([SumB]),0,[SumB])+IIf(IsNull([SumC]),0,
[SumC])+IIf(IsNull([SumD]),0,[SumD])))*100,2) AS CSI, Sum([SP RPT GET
RRE CSI PRE].SACD) AS ACD
FROM [SP RPT GET RRE CSI PRE] INNER JOIN (tblSplits INNER JOIN
(tblPIPEmployee AS Supervisors INNER JOIN (tblPIPEmployee AS EDA INNER
JOIN tblPIPEmployee ON EDA.Employee_ID = tblPIPEmployee.EDA) ON
Supervisors.Employee_ID = tblPIPEmployee.Supervisors) ON
(tblSplits.SplitID = tblPIPEmployee.GroupID) AND (tblSplits.DeptID =
tblPIPEmployee.DeptID)) ON [SP RPT GET RRE CSI PRE].EmployeeNO =
tblPIPEmployee.EmployeeNO
GROUP BY EDA.EmployeeNO, [SP RPT GET RRE CSI PRE].SplitID;