A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

2007 - count no of records in payments table for each student



 
 
Thread Tools Display Modes
  #1  
Old March 15th, 2007, 02:29 PM posted to microsoft.public.access.gettingstarted
JC[_2_]
external usenet poster
 
Posts: 4
Default 2007 - count no of records in payments table for each student

Hi Everybody,

I have a table of all the payments a student is scheduled to make during
one semester - tbCoursePayments - with the following principal fields:

intStudentID intPayRef dtMonth dtPayDue intAmountDue dtDatePaid dtAmountPaid

I have a form with a subform in datasheet view to list all the late
payments.

I can list those students who have payments still outstanding by
checking if dtDatePaid is empty.However, this shows some students more
than once. I would like to count the number of outstanding payments that
each student has and the total still outstanding.

1 - John - 2 late payments - $250
2 - Richard - 1 late payment - $135

I'd like to do this for all the students who have late payments.

Any help would be greatly appreciated,

Jeff C
  #2  
Old March 15th, 2007, 03:48 PM posted to microsoft.public.access.gettingstarted
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default 2007 - count no of records in payments table for each student

SELECT intStudentID,
Count(dtPayDue) As LatePayments,
Sum(intAmountDue) As AmountDue
FROM tbCoursePayments
WHERE dtDatePaid Is Null
GROUP BY intStudentID ;
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"JC" wrote:

Hi Everybody,

I have a table of all the payments a student is scheduled to make during
one semester - tbCoursePayments - with the following principal fields:

intStudentID intPayRef dtMonth dtPayDue intAmountDue dtDatePaid dtAmountPaid

I have a form with a subform in datasheet view to list all the late
payments.

I can list those students who have payments still outstanding by
checking if dtDatePaid is empty.However, this shows some students more
than once. I would like to count the number of outstanding payments that
each student has and the total still outstanding.

1 - John - 2 late payments - $250
2 - Richard - 1 late payment - $135

I'd like to do this for all the students who have late payments.

Any help would be greatly appreciated,

Jeff C

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.