G
Guest
I'm trying to use an IIf statement to calculate the average on the query but
it doesn't seem to work.here's an sql statement for my query:I created a
Union query first and now i wnt to average the values contained in these two
months: July and September
SELECT QAVG.Broker, QAVG.EffMonth, Avg(QAVG.AVERAGE) AS AvgOfAVERAGE,
IIf([effmonth]=#7/1/2004# and #9/1/2004#,Sum([average]),0) AS MYAVERAGE
FROM QAVG
GROUP BY QAVG.Broker, QAVG.EffMonth;
it doesn't seem to work.here's an sql statement for my query:I created a
Union query first and now i wnt to average the values contained in these two
months: July and September
SELECT QAVG.Broker, QAVG.EffMonth, Avg(QAVG.AVERAGE) AS AvgOfAVERAGE,
IIf([effmonth]=#7/1/2004# and #9/1/2004#,Sum([average]),0) AS MYAVERAGE
FROM QAVG
GROUP BY QAVG.Broker, QAVG.EffMonth;