Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cummulative Count of Courses Taken

Status
Not open for further replies.

nyamrembo

Technical User
Apr 15, 2010
52
0
0
US
Name Courses #of taken TakenDate Expires
Mary Employees 1 12/5/2009 12/5/2010
Mary Cust Service 1 10/5/2009 10/5/2010
Mary Employees 1 12/5/2008 12/5/2009
Mary Cust Service 1 10/5/2008 10/5/2009
Mary Marketing 1 05/5/2010 05/5/2011

Hello Again, I am trying to keep count of the employees and number of times they have taken a course. The courses are taken annually and some are only taken once. So for example, Mary in the above table has taken Customer service course 2 times since her employment.

Name Courses #of taken TakenDate Expires
Mary Cust Service 1 10/5/2009 10/5/2010
Mary Cust Service 1 10/5/2008 10/5/2009

So now what I would like to do is to create a report that shows Mary as having taken 2 Customer Service course and only show the last date taken and the expiration date like this:

Name Courses #of taken TakenDate Expires
Mary Cust Service 2 10/5/2009 10/5/2010

I know this is a long shot for someone like me who cannot code very well. But any ideas on how to go about it would be greatly appreciated. I have tried to use the count function in the query grid but it only works if I use the course ID which I can't do because I want the name of the course to show under courses instead.
The two tables are Employee and Courses
Thanks as always.[sunshine]
 
Code:
SELECT Name, Courses, Sum(Taken) As TotalTaken, Max(TakenDate) As RecentDate, Max(ExpiresDate) As ExpDate
FROM tblCourses
GROUP BY Name, Courses

Randy
 
Thank you. Will let you know next week if I run into a problem. Have a great weekend and Happy Friday[sunshine]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top