hi.
i have to print the time table in database .. like rows and columns. for example like this
1 2 3 4
mon
tue
wed
thu
fri
sat
so ,how to write the query and how to insert the rows and columns .can u tell me the answer..

I don't understand what data you're looking for. You can use a combination of a for or while loop to generate the data. You can also use DatePart and DateName to get specific information about dates and times. Please elaborate on your desired cursor and we'll go from there.

hi,
i mean print the time table in below format in database.1,2 are the periods(classes),and mon,tue,wed etc are the days. i am developing the school time table. In my design form,i created the table like this. inserting the data and after click on button the data will be saved in database in the below format. or else tell me the process ,how to develop the school time table. so can u tell me the code or process for that. thank you sir.
1 2 3 4
mon maths english science physics
tue computers --- ----- -----
wed ----- --- --- --- -----
thurs ------ ---- ---- ---- ----

You should have one table with the days of the week. Another table with the courses. And another table with what courses are offered on what day. Then given your sample data you would want to pivot the data but this would probably best be done in a query because you may have 6 classes on monday, 2 on wednesday, and 0 on saturday. The number of columns can't vary based on row unless you want to fill the undeeded columns with null but then you're starting to talk about bad design.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.