MS Access-多个表中的多个字段如何求和与不同

时间:2018-11-29 08:34:19

标签: ms-access

我创建了一个查询,该查询将通过组合框使用Student_Profile表中的Student_ID_Number在表单中显示数据并进行过滤。

如何显示Student_Payment_Table中的StudentTuitionFee_Pay(Field)的总和以及Student_Level_Fee表中的StudentTuitionFee(Field)的差异?

SELECT 
Student_Profile.Student_ID_Number, 
Student_Profile.Student_Nameenter
Student_Level_Fee.StudentLevel, 
Student_Level_Fee.StudentLevelName, 
Student_Level_Fee.StudentTuitionFee, 
Student_Level_Fee.StudentRegistrationFee, 
Student_Level_Fee.StudentBookFee, 
Student_Level_Fee.StudentMiscFee, 
Student_Level_Fee.StudentMiscOthers1, 
Student_Level_Fee.StudentMiscOthers2, 
Student_Level_Fee.StudentMiscOthers3, 
Student_Level_Fee.SchoolYear, 
Student_Payment_Table.Student_OR_Number, 
Student_Payment_Table.Student_OR_TAmount, 
Student_Payment_Table.Student_OR_Date, 
Student_Payment_Table.StudentTuitionFee_Pay, 
Student_Payment_Table.StudentRegistrationFee_Pay, 
Student_Payment_Table.StudentBookFee_Pay, 
Student_Payment_Table.StudentMiscFee_Pay, 
Student_Payment_Table.StudentMiscOthers1_Pay, 
Student_Payment_Table.StudentMiscOthers2_Pay, 
Student_Payment_Table.StudentMiscOthers3_Pay, 
Student_Payment_Table.SchoolYear_Pay

FROM Student_Level_Fee RIGHT JOIN 
(Student_Registration_Table LEFT JOIN (Student_Profile 
LEFT JOIN Student_Payment_Table ON Student_Profile.Student_ID_Number = Student_Payment_Table.Student_ID_Number) 
ON Student_Registration_Table.Student_ID_Number = Student_Profile.Student_ID_Number) 
ON Student_Level_Fee.StudentLevel = Student_Registration_Table.StudentLevel

WHERE (((Student_Profile.Student_ID_Number)=[Forms]![Search Payment Form]![Student_ID_Combo]));

0 个答案:

没有答案