I have a database with 3 tables:
Table : TimeTable
Column : TimeTableID
Table : SchoolDay
Column : SchoolDayID , SchoolDayName
Table : TimePeriod
Column : FromTime, ToTime, TimeTableID, SchoolDayID
SchoolDay will have 7 rows, Monday to Sunday. One TimeTable record will have dynamic Time Period records. I want to display the TimeTable in a gridview.
Day | FromTime | ToTime || FromTime | ToTime || ...
Mon |
Tue |
Wed |
Thu |
Fri |
Sat |
Sun |
The number of column should be dynamic based on the TimePeriod. It should display the maximum. Is it possible to write a long SQL to retrieve the data ? If so, how to write the SQL ?
Any idea ? Thanks.
Table : TimeTable
Column : TimeTableID
Table : SchoolDay
Column : SchoolDayID , SchoolDayName
Table : TimePeriod
Column : FromTime, ToTime, TimeTableID, SchoolDayID
SchoolDay will have 7 rows, Monday to Sunday. One TimeTable record will have dynamic Time Period records. I want to display the TimeTable in a gridview.
Day | FromTime | ToTime || FromTime | ToTime || ...
Mon |
Tue |
Wed |
Thu |
Fri |
Sat |
Sun |
The number of column should be dynamic based on the TimePeriod. It should display the maximum. Is it possible to write a long SQL to retrieve the data ? If so, how to write the SQL ?
Any idea ? Thanks.