navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Help with SQL code

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Help with SQL code
Page: [1]
 
DesiMcK

 

Posts: 445
Joined: 4/26/2004
From: Essex, UK
Status: offline

 
Help with SQL code - 4/6/2008 15:40:32   
Hi,

here is my problem. I have a table with four fields: ID, PupilID, Task, Mark

the table has values like this:

1 | Pupil1 | Task1 | Mark
2 | Pupil2 | Task1 | Mark
3 | Pupil3 | Task1 | Mark
etc

11 | Pupil1 | Task2 | Mark
12 | Pupil2 | Task2 | Mark
13 | Pupil3 | Task2 | Mark
etc

and so on.

What I would like is a table that list the pupils done the left and the tasks across the top with the corresponding marks lined up.

_______ Task1 Task2 Task3 etc
Pupil1
Pupil2
Pupil3

Is this possible with asp?

Thanks,

Desi
DesiMcK

 

Posts: 445
Joined: 4/26/2004
From: Essex, UK
Status: offline

 
RE: Help with SQL code - 4/7/2008 17:31:08   
This is the SQL code that works in Access:

TRANSFORM Avg(tblHomework.Mark) AS AvgOfMark
SELECT tblPupil.PupilID
FROM tblHomework INNER JOIN tblPupil ON tblHomework.PupilID = tblPupil.PupilID
GROUP BY tblPupil.PupilID, tblPupil.FirstName, tblPupil.Surname, tblHomework.ClassID, tblHomework.Task, tblHomework.DateSet, tblHomework.DateDue
PIVOT tblHomework.TaskID

How can I use it in an asp page. I am unsure how to set up the table.

Thanks for all your time and help.

Desi

(in reply to DesiMcK)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Help with SQL code
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts