I'm struggling with understanding Pivots. I've read thru what's in Microsoft Docs and a few other sites. I'm pulling in a field from a screen design called 'SCREENSCALE'. Here's an abbreviated view of my query.
INNER JOIN HISParticipant
ON INQUIRY.INQUIRYID = HISParticipant.EntityID
INNER JOIN HISParticipantName
ON HISParticipant.ParticipantID = HISParticipantName.ParticipantID
INNER JOIN INQDocumentATION
ON INQUIRY.INQUIRYID = INQDocumentATION.INQUIRYID
INNER JOIN SCREENDESIGN
ON INQDocumentATION.ScreenDesignID = SCREENDESIGN.SCREENDESIGNID
INNER JOIN SCREENQUESTIONS
ON SCREENDESIGN.SCREENDESIGNID = SCREENQUESTIONS.SCREENDESIGNID
INQUIRY.INQDATE >= @INQDATE
AND INQUIRY.INQDATE <= @INQDATE2
AND INQUIRY.Disposition IN (@Disposition)
AND SCREENDESIGN.SCREENDESIGNNAME IN (@SCREENDESIGNNAME)
AND SCREENQUESTIONS.SCREENSCALE IN (@SCREENSCALE)
I'm not getting the results I actually need because I believe I need to convert what I'm getting to Column Headings so that the actual results pull in. I'm trying to pull in data from fields that aren't actual db fields. I really hope I'm explaining this correctly.
SCREENSCALE = current column heading and db field
The values that are associated with First Name, Last Name, and Due Date are the actual results I need to get pulled in. I'm guessing that I need to make First Name, Last Name and Due Date the column headings so that the true results are reflected.
Everything I've read includes an aggregate and/or AS function. Is this going to be that complicated (from my perspective)? Again, I hope I explained this correctly.