Results 1 to 6 of 6

Thread: How can i display timetable using sqlserver with the time appearing as headers

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2020
    Location
    Kampala
    Posts
    45

    How can i display timetable using sqlserver with the time appearing as headers

    iam trying to use this link to create a time table but my problem is presenting it as seen in the images below
    https://stackoverflow.com/questions/...able-using-sql


    How can i diplay atime table like this below using sqlserver
    this is what i want to display
    Name:  Timetableshow2000.jpg
Views: 578
Size:  42.4 KB

    currently my view is displaying records in this way
    Attachment 192889
    Attached Images Attached Images  
    Last edited by Makumbi; Sep 18th, 2024 at 01:11 AM. Reason: making image more clearer

  2. #2
    Hyperactive Member
    Join Date
    Jul 2022
    Location
    Buford, Ga USA
    Posts
    491

    Re: How can i display timetable using sqlserver with the time appearing as headers

    There are some third-party data grid controls that allow for some fancy formatting. This article goes over some of the more popular options

    https://visualstudiomagazine.com/art...llections.aspx

  3. #3
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    12,064

    Re: How can i display timetable using sqlserver with the time appearing as headers

    Essentially what you're wanting to create is a pivot table, but it's not as simple as that because you want to block some time out entirely (e.g. 10:30 - 11:30 you want to display BREAK vertically.

    Leaving aside the custom time blocks, what language are you doing this in. Did you want to do this on the front-end using JavaScript (or some flavor thereof), the back-end using VB.NET or C#, or the database layer using SQL?

    The concept is the same, but the implementation will vary depending on where you want the data to be manipulated.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  4. #4

    Thread Starter
    Member
    Join Date
    Sep 2020
    Location
    Kampala
    Posts
    45

    Re: How can i display timetable using sqlserver with the time appearing as headers

    Quote Originally Posted by dday9 View Post
    Essentially what you're wanting to create is a pivot table, but it's not as simple as that because you want to block some time out entirely (e.g. 10:30 - 11:30 you want to display BREAK vertically.

    Leaving aside the custom time blocks, what language are you doing this in. Did you want to do this on the front-end using JavaScript (or some flavor thereof), the back-end using VB.NET or C#, or the database layer using SQL?

    The concept is the same, but the implementation will vary depending on where you want the data to be manipulated.
    Iam currently using sqlserver and asp.net vb

  5. #5
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    12,064

    Re: How can i display timetable using sqlserver with the time appearing as headers

    And where would you like to perform the business logic: front-end (JavaScript), back-end (VB.NET), or database (SQL Server)?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  6. #6
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,984

    Re: How can i display timetable using sqlserver with the time appearing as headers

    Adding to dday:
    He has "fixed" Time-Slots (=Column-Headers) and "fixed" Day-Slots (=Row-Headers).
    His business-Logic (wherever he implements it) must fit the retrieved Data into its correct slot inside this 2D-Matrix.
    Meaning: He has to check the retrieved record for
    1) which Day to determine the Row
    2) at what Time to determine which Columns (PLURAL), since the time-slots in his Query overlap the "fixed" time-slots
    3) How to proceed if a time-slot in the record overlaps into a break/Lunch time-slot (Monday 10:30 - 11:20)
    4) How to display "partial" time-slots (look at Monday Course INF214)
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width