Hi, I have this query,
SELECT Deployers.Deployers, Deployers.Population, Sum(Statistics.Tot_calls_by_Month) AS System_Total, Deployers.Months_Operational, Max(Statistics.Tot_calls_by_Month) AS PMTot, Sum([Tot_calls_by_Month])/([Months_Operational]) AS AvgPM, Sum([Tot_calls_by_Month])/([Months_Operational])/([Population]) AS CPP, Sum(Nz([Statistics.Peak_call_count],0)) AS PCallCount, Sum(Nz([Statistics.Peak_call_hour_count],0)) AS PHourCount, Sum(Nz([Statistics.N_of_dropped_calls],0)) AS Dcalls, Sum(Nz([Statistics.Average_call_length],0)) AS AvgCLlength, Sum(Nz([Statistics.Total_minutes_per_month],0)) AS TotMPMonth, =Sum([Statistics.P_wireless])/Sum(IIf([Statistics.P_wireless]=0,0,1)) AS Wless, =Sum([Statistics.P_wireline])/Sum(IIf([Statistics.P_wireline]=0,0,1)) AS Wline, =Sum([Statistics.P_category])/Sum(IIf([Statistics.P_category]=0,0,1)) AS Cat, =Sum([Statistics.Traffic])/Sum(IIf([Statistics.Traffic]=0,0,1)) AS Traf
When I run it I get this,
I choose this column "P_Wireline"
as an example. I get the same thing for every field I used the ([])/Sum(IIf([]=0,0,1)) function
P_Wireline
0
0.476781483049746
0
#Error
#Error
#Error
0.447277781036165
0
#Error
#Error
0.600000023841858
#Error
#Error
0.436100006103516
#Error
#Error
#Error
#Error
#Error
#Error
3.99999991059303E-02
1.7092591971159
Why am I getting the #Error?
SELECT Deployers.Deployers, Deployers.Population, Sum(Statistics.Tot_calls_by_Month) AS System_Total, Deployers.Months_Operational, Max(Statistics.Tot_calls_by_Month) AS PMTot, Sum([Tot_calls_by_Month])/([Months_Operational]) AS AvgPM, Sum([Tot_calls_by_Month])/([Months_Operational])/([Population]) AS CPP, Sum(Nz([Statistics.Peak_call_count],0)) AS PCallCount, Sum(Nz([Statistics.Peak_call_hour_count],0)) AS PHourCount, Sum(Nz([Statistics.N_of_dropped_calls],0)) AS Dcalls, Sum(Nz([Statistics.Average_call_length],0)) AS AvgCLlength, Sum(Nz([Statistics.Total_minutes_per_month],0)) AS TotMPMonth, =Sum([Statistics.P_wireless])/Sum(IIf([Statistics.P_wireless]=0,0,1)) AS Wless, =Sum([Statistics.P_wireline])/Sum(IIf([Statistics.P_wireline]=0,0,1)) AS Wline, =Sum([Statistics.P_category])/Sum(IIf([Statistics.P_category]=0,0,1)) AS Cat, =Sum([Statistics.Traffic])/Sum(IIf([Statistics.Traffic]=0,0,1)) AS Traf
When I run it I get this,
I choose this column "P_Wireline"
as an example. I get the same thing for every field I used the ([])/Sum(IIf([]=0,0,1)) function
P_Wireline
0
0.476781483049746
0
#Error
#Error
#Error
0.447277781036165
0
#Error
#Error
0.600000023841858
#Error
#Error
0.436100006103516
#Error
#Error
#Error
#Error
#Error
#Error
3.99999991059303E-02
1.7092591971159
Why am I getting the #Error?