Ready to get started with anonymous questions today? It's easy! Learn more.
select s.personid,hh.name as HouseholdName,i.lastname +', '+ i.firstname as Guardian,r.name as relationship,s.surveyid,sr.questionid as Question, case sq.description when 'PTO: Please choose below' then 'PTO permission' end Description, case sr.response when 'No, Do not allow my information to be shared' then 'N' when 'Yes, I allow my Information to be shared' then 'Y' end Response, r.personid2 as StudentPID,p.studentnumber as studentid, i2.firstname + ', '+ i2.lastname as Student, h.householdid, hh.phone from dbo.SurveyResponse s inner join [identity] as I on i.personid = s.personid inner join surveyquestionresponse as sr on sr.responseid =s.responseid inner join surveyquestion as sq on sq.questionid = sr.questionid inner join relatedpair as R on r.personid1 = s.personid left outer join [identity] as I2 on I2.personid = R.personid2 left outer join person as p on p.personid = I2.personid left outer join householdmember as h on h.personid = p.personid left outer join household as hh on hh.householdid =h.householdid where r.guardian = '1' and h.enddate is null --and sr.questionID in (@questionid)
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.