当我执行查询时,我收到一个错误 [英] When I execute the query I get an error
问题描述
Tb_Sch_Time_Table表在Access数据库中记录如下
Sch_Date Session Faculty_Code Course
4/15/2013 1 DM CL2
4/15/2013 2 VRV CL2
4/16/2013 1 VRV CL2
4/16/2013 2 AKR CL2
4/17/2013 1 GS CL2
4/17/2013 2 VRV CL2
4/18/2013 1 GS CL2
4/18/2013 2 DS CL2
从上表记录中我想要的输出如下:
Sch_Date第1节第2节
4/15/2013 DM VRV
4/16/2013 VRV AKR >
4/17/2013 GS VRV
4/18/2013 GS DS
获得上述输出我'已经写了上面的查询如下;
TRANSFORM MAX(Faculty_Code)
SELECT Sch_date
FROM Tb_SCh_TIme_Table 其中 Course = ' CL2'
GROUP BY 课程
PIVOT [会话]
当我执行上述查询时,我收到以下错误:
您试图执行一个不包含指定表达式sch_date的查询作为聚合函数的一部分。
请帮助我,我的查询有什么问题?
Sch_Date第1节第2节
4/15/2013 DM VRV
4/16/2013 VRV AKR
4/17/2013 GS VRV
4/18/2013 GS DS >
如何获得上述输出?
问候,
Narasiman P.
看到这个问题似乎与你的相同:
输出结果为在ms访问中与数据库不匹配 [ ^ ]
Tb_Sch_Time_Table table records as follows in Ms Access Database
Sch_Date Session Faculty_Code Course
4/15/2013 1 DM CL2
4/15/2013 2 VRV CL2
4/16/2013 1 VRV CL2
4/16/2013 2 AKR CL2
4/17/2013 1 GS CL2
4/17/2013 2 VRV CL2
4/18/2013 1 GS CL2
4/18/2013 2 DS CL2
From the above table records I want the output as follows:
Sch_Date Session 1 Session 2
4/15/2013 DM VRV
4/16/2013 VRV AKR
4/17/2013 GS VRV
4/18/2013 GS DS
for getting the above output I''ve written the above query as follows;
TRANSFORM MAX(Faculty_Code)
SELECT Sch_date
FROM Tb_SCh_TIme_Table where Course = 'CL2'
GROUP BY Course
PIVOT [Session]
When I execute the above query, I get the following error:
"You tried to execute a query that does not include the specified expression sch_date as part of aggregate function."
Please help me, what is the problem with my query?
Sch_Date Session 1 Session 2
4/15/2013 DM VRV
4/16/2013 VRV AKR
4/17/2013 GS VRV
4/18/2013 GS DS
How can I get the above output?
Regards,
Narasiman P.
See this question which seems to be identical to yours:
The output is not matching with database in ms access[^]
这篇关于当我执行查询时,我收到一个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!