我使用这个SQL:透视组合框表
TRANSFORM Max(table1.[quiz]) AS MaxOfquiz
SELECT table1.[quizdate], table1.[studentname], Max(table1.[quiz]) AS [Total Of
quizscores]
FROM table1
GROUP BY table1.[quizdate], table1.[studentname]
PIVOT table1.[coursename];
要尝试并转动组合框表:
表1
ID quizdate coursename studentname quiz
1 02-Jan-21 math john 100
2 03-Feb-21 science joe 99
3 04-Mar-21 physics monica 97
4 05-Apr-20 language mike 88
凡coursename是一个下拉(数学,科学,物理,语言)分成
表2
studentname math science physics language
john 100
joe 99
monica 97
mike 88
我得到这些结果:
quizdate studentname Total Of quizscores 1 2 3 4
4/4/2016 moe 88 88
1/1/2017 john 100 100
2/2/2017 joe 99 99
3/3/2017 monica 97 97
似乎COMBOX箱coursename不能转动作为列名,但 用数字代替。任何人都可以解释我如何产生正确的结果?
为什么你甚至想要使用CROSSTAB查询作为组合框的RowSource? – June7