Thanks I'll give it a try and see how it goes.:)
Ole123
Posts
-
Cross-tab query -
Cross-tab queryI'm trying to build a cross-tab query that is dynamic in mssql 2000. Since it does use the transform syntax I am stuck at doh The columnheader will always change. So it's more of a dynamic columnheader. Depending on the Day of the week. There could be 5 or 3 or 10 teacher who have classes to teacher at different time of the day. The Teacher's names will be the columnheader Teaher's names across the top The time is in the left column down and student name ____ Teacher_Name Teacher_Name Teacher_Name Teacher_Name Time Student_Name Student_Name Student_Name Student_Name Time Student_Name Student_Name Student_Name Student_Name Time Student_Name Student_Name Student_Name Student_Name C2 and R2 = Student_Name C3 and R2 = Student_Name C2 and R3 = Student_Name C1 and R3 = Student_Name and so on The only way i can build a cross-tab query is in crystal report. Any help would be gladly appreciated :(( I want to display the data in a listview or datagrid. I'm lossing hair here and i have a bit left. I'll look like homer in now time with 3 strings of hair. :mad:
-
Custom ColumheaderThe columnheader will always change. So it's more of a dynamic columnheader. Depending on the Day of the week. There could be 5 or 3 or 10 teacher who have classes to teacher at different time of the day. The Teacher's name will be the columnheader Basically i'm trying to build a cross-tab query Teaher's names across the top The time is in the left column down and student name Teacher_Name Teacher_Name Teacher_Name Teacher_Name Time Student_Name Student_Name Student_Name Student_Name C1 and R2 = Student_Name C2 and R2 = Student_Name C1 and R3 = Student_Name C1 and R3 = Student_Name and so on The only way i can build a cross-tab query is in crystal report. ;)
-
Custom ColumheaderStill a little stuck so i still need help. I posted a sample tables in the post and what the display should look like... Thanks for all your help. I have been kicking my self for about two weeks trying to get the display i want with no success. MSSql does not use the Transform sytnax so i'm not able to create the crosstab look and feel for my listview form in vb.net. Thanks again for all your help:)
-
Custom ColumheaderStudent_ID | Student_Lname | Student Fname | Subject ID | ---------------------------------------------------------------------- 125 | Mason | Steven | 2 | 100 | Jude | Bob | 2 | 199 | Mason | Mark | 2 | 125 | Mason | Steven | 4 | 225 | Stevenson | John | 2 | 125 | Mason | Steven | 5 | 400 | Madison | Ira | 2 | Teacher_ID | Teacher_Lname | Teacher_Fname | Subject ID | Subject Name| Date | Time| ------------------------------------------------------------------------------------------------------------ 1 | Mason | Steven | 2 | Math | 1/1/2004 | 11:00 am 2 | long | Gary | 2 | English|| 1/1/2004 | 1:00 pm 3 | Clark | James | 2 | P.E| 1/1/2004 | 11:00 am 4 | Simmons | Micheal | 4 | Science| 1/1/2004 | 11:00 pm 5 | Bonnila | Richard | 2 |Art | 1/1/2004 | 11:00 am 6 | Law | Katherine | 5 |Social Studies| 1/1/2004 | 9:00 am 7 | Young | David | 2 | Econ| 1/1/2004 | 8:00 am It should be displayed in the list view as Teachers |Prof. Clark | Prof. Brooke | Prof. Daniels ___________________________________________ Time ____________________________________________ 8:00 | Peter Robertson | Blank|Blank ____________________________________________ 9:00 |James Keith | Blank|Blank ____________________________________________ 10:00| Blank|Blank| Blank ____________________________________________ 11:00| Blank|Blank| Blank ____________________________________________ 12:00| Blank|Blank| Blank ____________________________________________ 1:00| Blank|Blank| Blank ____________________________________________ 2:00 | Blank|Blank| James Keith ____________________________________________
-
Custom ColumheaderI forgot to add that the student data is a seperate table as well as the teacher's data. So I have a Student and Teacher table. I don't think I could use a stored procedure.
-
Custom ColumheaderStudent_Name Teacher_Namer Subject Time Date James Keith Prof. Clark Math 9:00am 01/05/2004 James Keith Prof. Moore English 10:00am 01/05/2004 James Keith Prof. Smith Art 11:00am 01/05/2004 James Keith Prof. James P.E 1:00pm 01/05/2004 James Keith Prof. Brooke Chem 2:00pm 01/05/2004 James Keith Prof. Daniels Math 3:00pm 01/05/2004 Peter Robertson Prof. Clark Math 8:00am 01/05/2004 Peter Robertson Prof. Moore English 12:00am 01/05/2004 Peter Robertson Prof. Smith Art 4:00pm 01/05/2004 Peter Robertson Prof. James P.E 5:00pm 01/05/2004 Peter Robertson Prof. Brooke Chem 6:00pm 01/05/2004 Peter Robertson Prof. Daniels Math 7:00pm 01/05/2004 Teachers + Prof. Clark + Prof. Brooke + Prof. Daniels +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Time +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 8:00 + Peter Robertson + + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 9:00 + James Keith + + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 10:00 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 11:00 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 12:00 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1:00 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2:00 + + James Keith +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The list view will be controlled by a date or calendar control. Haven’t decided whether to use a stored procedure. Since I use a select statement with a case argument. Still not getting the look I want. It would be similar to a cross tab table used in ms access.
Teachers Prof. Clark Prof. Brooke Prof. Daniels Time
-
Custom ColumheaderHow do you pull data from a database and set them as columnheader in listview or a datagrid?:((