troubleshooting Question

sum field and Show empty records ( IS NULL) ??

Avatar of asrgrant
asrgrant asked on
Microsoft SQL Server
4 Comments1 Solution399 ViewsLast Modified:
I want have 2 tables: Personnel and Unit_time. Im currently displaying a grid, attached, but want to show the "personnel.surname" that have not added to "unit_time.hour". So i basically want to show a full grid of people including those that have not entered "hours"
SELECT personnel.rank, personnel.surname, Sum(unit_time.hours) AS SumOfhours, unit_time.personID, Count(unit_time.personID) AS CountOfpersonID

FROM personnel INNER JOIN unit_time ON personnel.PersonID = unit_time.personID
WHERE unit_time.datestamp  between firstdate AND secdate

GROUP BY personnel.surname, unit_time.personID,personnel.rank

Many Thanks

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 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 4 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