Friday, February 24, 2012

Attendance information retreival

Hi,
i need to retreive from a data from a database and show it in a grid. the data is actually a Card Reader database which actually stores the UserId , Date,StartTime,EndTime. the user will have multiple starttime and end time on the same date. My question is how to display the data in ASP.net Grid or datalist or Repeater control like below which will calculate the totl time in a day the user has spent in the office
UserID Date Hours
1 10/06/2007 8
1 11/06/2007 10
1 12/06/2007 9
2 10/06/2007 11
3 12/06/2007 12
3 13/06/2007 10

Note: Atleast youcan give me the SQL Statement for MS SQL Server for this it will be really helpful..
I really apprecaite your continous effort in helping developers in acheiving their target..
Sonu..

Quote:

Originally Posted by Sonu Koshy

Hi,
i need to retreive from a data from a database and show it in a grid. the data is actually a Card Reader database which actually stores the UserId , Date,StartTime,EndTime. the user will have multiple starttime and end time on the same date. My question is how to display the data in ASP.net Grid or datalist or Repeater control like below which will calculate the totl time in a day the user has spent in the office
UserID Date Hours
1 10/06/2007 8
1 11/06/2007 10
1 12/06/2007 9
2 10/06/2007 11
3 12/06/2007 12
3 13/06/2007 10

Note: Atleast youcan give me the SQL Statement for MS SQL Server for this it will be really helpful..
I really apprecaite your continous effort in helping developers in acheiving their target..
Sonu..


try:

select, userId, date, hours, OtherColumnsThatYouWantToInclude from YourTable
where (condition of records that you want to include or exclude)

No comments:

Post a Comment