I'm trying to get results from my SQL code but I can't seem to get them right. Here is my code:
select tBlocking.WholeCompany, tBlocking.BlockingDate, tSearch.Description, tUser.FirstName + ' ' + tUser.LastName as Partner, tCompany.CompanyName, tBlocking.BlockingNotes, tPeople.FirstName, tPeople.LastName from tBlocking
LEFT JOIN tCompany on tBlocking.CompanyGUID = tCompany.GUID
LEFT JOIN tSearch ON tBlocking.SearchGUID = tSearch.GUID
LEFT JOIN tBlockingDetail ON tBlocking.GUID = tBlockingDetail.BlockingGU
LEFT JOIN tPeople ON tBlockingDetail.PeopleGUID
LEFT JOIN tSearchResponsibility ON tSearchResponsibility.Sear
chGUID = tSearch.GUID
LEFT JOIN tUser ON tSearchResponsibility.User
GUID = tUser.GUID
LEFT JOIN tRole ON tSearchResponsibility.Role
GUID = tRole.GUID
WHERE tBlocking.BlockingDate > GetDate()
I have attached a worksheet with the results I get (yellow) and the ones I want (green).
As you can see the ones in yellow return multiple lines because there are more than one Partner assigned to that company. What I would like to have is when there are more, they show up as they do in green. THere is no max on how many Partners assigned to each company.
How can I get the desired effects?