Question : Divsion by zero

This is related by my previous question.  The below works fine as a non-totals query but kicks back the error "Division by zero" when I use the aggregate function Avg.  I have no idea where this is coming from.  Can somoeone please assist?  Thank you.
1:
2:
3:
4:
5:
SELECT tblAccounts.msAccount, tblFiscalCalendar.yrMonth, Avg(qryFinalDailyAnalytics.origCost) AS AvgOforigCost, Avg(qryFinalDailyAnalytics.bookValue) AS AvgOfbookValue, Avg(qryFinalDailyAnalytics.accrInt) AS AvgOfaccrInt, Avg(qryFinalDailyAnalytics.mktValue) AS AvgOfmktValue, Avg(qryFinalDailyAnalytics.purchYield) AS AvgOfpurchYield, Avg(qryFinalDailyAnalytics.currYield) AS AvgOfcurrYield, Avg(qryFinalDailyAnalytics.duration) AS AvgOfduration, Avg(qryFinalDailyAnalytics.DTEM) AS AvgOfDTEM, Avg(qryFinalDailyAnalytics.DTFM) AS AvgOfDTFM
FROM (tblAccounts LEFT JOIN tblFiscalCalendar ON tblAccounts.calendarID = tblFiscalCalendar.calendarId) LEFT JOIN qryFinalDailyAnalytics ON tblFiscalCalendar.calendarId = qryFinalDailyAnalytics.calendarID
WHERE (((qryFinalDailyAnalytics.dataDate) Between [startDate] And [endDate]))
GROUP BY tblAccounts.msAccount, tblFiscalCalendar.yrMonth
ORDER BY tblAccounts.msAccount, tblFiscalCalendar.yrMonth;
Related Solutions: Use of MS Access Switch()

Answer : Divsion by zero

You created a class Person inside the clsHCCPeople, which you may or may not have wanted to do.

In order to access it, you have to do this:

Public Class clsPersonBusinsess
    Dim hccStudent As clsHCCPeople.Student

End Class

Otherwise, move the Student outside of the class definition for clsHCCPeople
Random Solutions  
 
programming4us programming4us