troubleshooting Question

Sum multiple fileds in a join but return one record that they belong to

Avatar of asrgrant
asrgrant asked on
Microsoft AccessMicrosoft SQL Server
5 Comments1 Solution420 ViewsLast Modified:
Hi .. Im trying (as im a beginner) to join a lot of tables and sum one of the fields in one of the tables. See attached.

Im trying to display a record set that sums the amount of hours (tbl unit_time.hours) that a person (tbl personnel.personID) worked on a single task (tbl t_persontask.taskID). Ive had a go but the result set shows the hours worked , not summed, but also repeats the taskID in a repeat region. Im stuck.

I am using this ...

SELECT t_persontask.PersonID, personnel.*, tasking.*, customer.*, system_set.*
FROM personnel INNER JOIN (((tasking INNER JOIN t_persontask ON tasking.taskID = t_persontask.taskID) INNER JOIN system_set ON tasking.sys_setID = system_set.sys_setID) INNER JOIN customer ON tasking.customerID = customer.customerID) ON personnel.PersonID = t_persontask.personID
WHERE personnel.PersonID=MMColParam
ORDER BY taskref DESC

... and I want to try and sum up the hours worked for an individual. The screen shot attached shows the output..(see screenshot.gif)
taskingj-oins.gif
taskingj-oins2.gif
screenshot.gif
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros