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.