Originally Posted by
Khan
I planned to refine after completing all the options.
Originally Posted by
Khan
Because these fields are from SPREADSHEET, I imported to Ms ACCESS. Already told you, that I will refine/Normalize them after completing the options.
Any time spent fixing the problem now will be wasted because once you start the normalization process, everything will need to be changed - tables, queries, forms, reports and code.
Without your dB to test, I would suggest checking the query "QryStudentForMonthly" to be sure that the correct records are returned.
This is untested :
Create a new query named "qryStudentCount"
Code:
SELECT Student.StudentID, Student.StudentName, Student.FatherName, Student.ClassID, Student.ClassName, Student.MonthlyFees, Student.AdmissionFees, Student.AnnualFees, Student.StationaryFees, Student.OtherFees, Student.OpgBalance, Student.Active, Student.LastPaymentChallan, Student.LastPaymentDate, Student.LastDuesAmount, Student.LastPaymentAmount
FROM Student WHERE Student.Active = True ORDER BY Student.StudentID;
How many records are returned?
Is the number of DISTINCT Students correct?
Now create another NEW query named "qryTestStudentforMonthly":
Code:
SELECT DISTINCTROW qSM.StudentID, qSM.StudentName, qSM.FatherName, qSM.ClassID, qSM.ClassName, Date() AS Date0, Nz([qSM].[MonthlyFees],0)*Nz([Forms]![CreatMonthlyChallan]![TxtNoOfMonths],1) AS MonthlyFees, [Enter AdmissionFees] AS AdmissionFees, [Enter AnnualExamFees] AS AnnualExamFees, [Enter StationaryFees] AS StationaryFees, [Enter OtherFees] AS OtherFees, Nz([Student].[MonthlyFees],0)*Nz([Forms]![CreatMonthlyChallan]![TxtNoOfMonths],1)+Nz([AdmissionFees])+Nz([annualExamFees],0)+Nz([StationaryFees],0)+Nz([OtherFees],0) AS CurrentDues, qSM.Balance AS PreviousDues, Nz([CurrentDues],0)+Nz([PreviousDues],0) AS TotalDues, Nz([TotalDues],0) AS Balance, qSM.LastPaymentChallan, qSM.LastPaymentDate, qSM.LastDuesAmount, qSM.LastPaymentAmount, Nz([LastChallanAmount],0)+Nz([LastPaymentAmount],0) AS LastChallanBalance FROM QryStudentforMonthly As qSM LEFT JOIN ChallanData ON qSM.StudentID = ChallanData.StudentID ORDER By qSM.StudentID
How many records are returned?
Edit the query "qryTestStudentforMonthly" and replace the query name "QryStudentforMonthly" with "qryStudentCount" so it looks like
Code:
SELECT DISTINCTROW qSM.StudentID, qSM.StudentName, qSM.FatherName, qSM.ClassID, qSM.ClassName, Date() AS Date0, Nz([qSM].[MonthlyFees],0)*Nz([Forms]![CreatMonthlyChallan]![TxtNoOfMonths],1) AS MonthlyFees, [Enter AdmissionFees] AS AdmissionFees, [Enter AnnualExamFees] AS AnnualExamFees, [Enter StationaryFees] AS StationaryFees, [Enter OtherFees] AS OtherFees, Nz([Student].[MonthlyFees],0)*Nz([Forms]![CreatMonthlyChallan]![TxtNoOfMonths],1)+Nz([AdmissionFees])+Nz([annualExamFees],0)+Nz([StationaryFees],0)+Nz([OtherFees],0) AS CurrentDues, qSM.Balance AS PreviousDues, Nz([CurrentDues],0)+Nz([PreviousDues],0) AS TotalDues, Nz([TotalDues],0) AS Balance, qSM.LastPaymentChallan, qSM.LastPaymentDate, qSM.LastDuesAmount, qSM.LastPaymentAmount, Nz([LastChallanAmount],0)+Nz([LastPaymentAmount],0) AS LastChallanBalance FROM qryStudentCount As qSM LEFT JOIN ChallanData ON qSM.StudentID = ChallanData.StudentID ORDER By qSM.StudentID
How many records are returned?