EDIT: I reformatted to improve readability of tables.This is probably so simple but for some reason I seen to be having a hard time wrapping my head around it. Be forewarned I am definitely still in the learning stages of more advanced SQL. I have been in the IT field for quite a long time but it was spent in the general practitioner field (i.e. IT Coordinator/Manager for SMB's). I now have the opportunity to dig a little more on the development side - I like it but it can be a painful process.Process is that members log on to a web site to evaluate "employees". The employee is then rated 1 thru 5 (blanks are accepted and are listed as no response/NULL in table) on 11 different questions. Each record in the table is a separate evaluation. Basically you get the evaluation data as displayed below.DATA:EmployeeQ1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q111 5 5 5 5 5 5 5 5 5 5 51 NULL NULL NULL NULL NULL NULL NULL NULL NULL 5 NULL1 5 5 5 5 5 5 5 5 5 5 51 4 5 5 5 5 3 3 5 1 5 51 5 5 5 5 5 5 5 5 5 5 51 3 3 3 3 3 3 3 3 3 3 32 5 5 5 5 5 5 5 5 5 5 52 4 4 4 4 4 4 4 4 4 5 42 4 5 5 4 4 4 5 4 4 4 42 5 5 5 5 5 5 5 5 5 5 52 5 5 5 5 5 5 5 5 5 5 52 5 5 5 5 5 5 5 5 5 5 53 5 5 5 5 5 5 5 NULL NULL NULL3 5 5 5 5 5 5 5 5 5 5 53 5 5 5 NULL NULL NULL NULL NULL NULL NULL NULL3 4 4 4 4 3 5 4 1 5 4 43 5 5 5 5 5 5 5 5 5 5 53 5 5 5 5 5 4 5 5 5 5 5
Sounds pretty straight forward hopefully. Now I want the data out of the table in a more presentable format - a single page report for each evaluated employee.DESIRED FORMAT:Emp = 1 Blank 1 2 3 4 5 AverageQ1 1 0 0 1 1 3 4.4Q2 1 0 0 1 0 4 4.6Q3 1 0 0 1 0 4 4.6Q4 1 0 0 1 0 4 4.6Q5 1 0 0 1 0 4 4.6Q6 1 0 0 2 0 3 4.2Q7 1 0 0 2 0 3 4.2Q8 1 0 0 1 0 4 4.6Q9 1 1 0 1 0 3 3.8Q10 0 0 0 1 0 5 4.7Q11 1 0 0 1 0 4 4.6
I was trying (and failing) to create a SQL SELECT statement that would output:EmpQuestionBlank_Count1_Count2_Count3_Count4_Count5_Count1 1 1 0 0 1 1 31 2 1 0 0 1 0 41 3 1 0 0 1 0 41 4 1 0 0 1 0 41 5 1 0 0 1 0 41 6 1 0 0 2 0 31 7 1 0 0 2 0 31 8 1 0 0 1 0 41 9 1 1 0 1 0 31 10 0 0 0 1 0 51 11 1 0 0 1 0 42 1 you get the idea….. 2 2 2 3 2 4 2 5
I am somewhat familiar with Crystal and Reporting Services so I am more looking for assistance with the SQL side and an understanding of the proper method to do this. Am I way off base here on the technique? Any suggestions/help would be appreciated.