i want to make an attendance database by using visual basic.net, i have one main table that keep the days, each day have a separate column, but what i need is to insert each day multiple periods, so how can i do it please..
thanks all members.
Technology Tips and News
i want to make an attendance database by using visual basic.net, i have one main table that keep the days, each day have a separate column, but what i need is to insert each day multiple periods, so how can i do it please..
thanks all members.
Hello,
You question is not clear for me. Please post DDL of your table, some sample data as INSERT statement and the expected result.
Just a guess
MERGE statement along with output.inserted table.
I wont recommend a design like this. Ideally you should store data as rows one for each date in the database table. You dont need to worry on display format while designing table/ storing the data.
Its very easy to generate attendance data column wise from rowwise stored data in the table. You can use readymade reporting tools like SQL reporting Services which has standard features like Matrix containers for doing dynamic pivotting like this. If you want to use languages like VB also you can create pivot logic inside.
In SQL if you want to do this you can use PIVOT operator or classic crosstabbing solutions as shown in below links
http://beyondrelational.com/modules/2/blogs/70/posts/10840/dynamic-pivot-in-sql-server-2005.aspx