Sum without repeats (1 Viewer)

nikhatter

New member
Local time
Yesterday, 22:48
Joined
Jun 6, 2008
Messages
3
Hey all, new here and new to access.

Here's my problem:

my company keeps track of training for several different companies. We have a access 2003 database in place but it is flat and we cannot report what we need to from it. so I am working on a new one.

I need a query that grabs "student info" from the "student info table," and "hours" from the course table and add up all the hours each student has taken.

Here is the query sql i have so far.

SELECT DISTINCT Master.[Student Info]
FROM Course INNER JOIN Master ON Course.[Course Name] = Master.[Course Name];


my problem is the adding of hours. I can list them all and add them manually but I'm trying to cut that step out.
any help would be great.

Thanks,
Nik
 

nikhatter

New member
Local time
Yesterday, 22:48
Joined
Jun 6, 2008
Messages
3
I'm going to check the archives while I wait for an answer....I'm not trying to be a free loader....a lot of this stuff is over my head for now.

Thanks again,
Nik
 
Local time
Yesterday, 22:48
Joined
Mar 4, 2008
Messages
3,856
Look at:
Group By
Sum()

This is pretty easy to do with the Access visual query designer thingy (though I prefer to use SQL view).
 

nikhatter

New member
Local time
Yesterday, 22:48
Joined
Jun 6, 2008
Messages
3
For being a beginner, I like Access visual query designer thingy, so I'll give it a looksy.

my approach was going to be some command that would compare SSN's and then total all hours logged per class for each SSN, in order to come out with a grand total. and if I say only "uniques", then I will not have a total number of hours for each of the 20 times they went through a training course but instead only listed once.

Thanks,
Nik
 
Local time
Yesterday, 22:48
Joined
Mar 4, 2008
Messages
3,856
That's what Group By and Sum are for. No duplicates...only the sums of the fields you want summed-once.
 

Users who are viewing this thread

Top Bottom