Click here to Skip to main content
15,898,747 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
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;

SQL
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.
Posted
Updated 13-May-13 22:44pm
v3

1 solution

See this question which seems to be identical to yours:

The output is not matching with database in ms access[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900