![]() |
|
|
#1
|
|||
|
|||
|
Hey Guys,
I opened access for the first time last week and I've gotta say it's pretty amazing. I'm trying to create a more sophisticated system for my little music school (as in, keeping records instead of losing them!). I've been doing ok but I've just been stumped by some angry sounding error messages! Here is the problem: I need a system to tell me how many lesson credits are remaining for each student. I have two queries: a) lesson totals and b)attendance totals. Here is a) Lesson Totals: SELECT Invoice.StudentID, Invoice.InstructorID, Sum([PaymentAmount]/20) AS Credits FROM Invoice GROUP BY Invoice.StudentID, Invoice.InstructorID; Here is b) Attendance Totals: SELECT Attendance.StudentID, Attendance.InstructorID, Sum(Attendance.CreditsUsedToday) AS SumOfCreditsUsedToday FROM Attendance GROUP BY Attendance.StudentID, Attendance.InstructorID; I've tried to amalgamate the two queries in a new query. The idea is something like: SELECT [Attendance Totals].StudentID, Sum([Credits]-[sumofcreditsusedtoday]) AS Remainder FROM [Attendance Totals], [Lesson Totals] GROUP BY [Attendance Totals].StudentID; Unfortunately the Remainder comes up with values that I can't interpret. If you see the attached pictures you'll see that the values in the Credits Column are small numbers but the results in the Remainder Column are related incorrectly. Any ideas? ![]()
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Combining Two Queries | csolomon | Queries | 1 | 09-03-2009 11:33 AM |
| Crosstab Queries | albst130 | Queries | 0 | 03-07-2007 06:32 AM |
| Queries the max from two rows | mohsin74 | Queries | 0 | 12-14-2006 09:52 PM |
| VBA and stacked queries | Pudy | Queries | 0 | 11-28-2006 12:58 PM |
| Time queries | ddog171 | Queries | 2 | 06-04-2006 04:45 PM |