I'm starting out with a wizard-created crosstable and a wizard-created report. The crosstable looks like this:
It contains for each question the information how many times each answer (1-5) was given. The "<>" column tells me how many times no answer at all was given (that is how many times qBase.answer had no value). It was added automatically by the wizard, I have no idea how.
Since there are various filter criteria, I don't want to use the wizard-generated static crosstable query, but instead use a dynamically generated SQL statement, which I assign to the report in the report_open handler with me.RecordSource = mySQLstring.
I have already learned that I must explicitly include the column headings to the PIVOT statement. When I simply add (1,2,3,4,5), all is fine, except that I don't get the "<>" column. I alread tried (1,2,3,4,5, "<>"), but that doesn't work of course... ?
Code:
SQL Query:
TRANSFORM Count(qBase.Code) AS numberOfCode
SELECT qBase.question
FROM qBase
GROUP BY qBase.question
ORDER BY qBase.question
PIVOT qBase.answer;
Result:
question <> 1 2 3 4 5
q1 5 12 55 9 4 1
q2 1 4 9 15 21 32
...
Since there are various filter criteria, I don't want to use the wizard-generated static crosstable query, but instead use a dynamically generated SQL statement, which I assign to the report in the report_open handler with me.RecordSource = mySQLstring.
I have already learned that I must explicitly include the column headings to the PIVOT statement. When I simply add (1,2,3,4,5), all is fine, except that I don't get the "<>" column. I alread tried (1,2,3,4,5, "<>"), but that doesn't work of course... ?