Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
roko1234
Starting Member
2 Posts |
Posted - 2010-08-16 : 07:42:23
|
I have a table on SQL server:TimeAttendance:-UserID-StartTime-EndTime From this table i would like to display the following:Period UserID Minutes00:00 - 01:00 1 3700:00 - 01:00 2 6000:00 - 01:00 5 6001:00 - 02:00 1 3701:00 - 02:00 2 6001:00 - 02:00 5 60...22:00 - 23:00 ...23:00 - 00:00 ....... and so on for other hours in day.Can somebody help please... |
|
Sachin.Nand
2937 Posts |
Posted - 2010-08-16 : 07:44:38
|
What is the data in your table TimeAttendance?Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless. PBUH |
 |
|
roko1234
Starting Member
2 Posts |
Posted - 2010-08-16 : 07:52:51
|
1 2009-05-10 07:26:40.000 2009-05-10 10:43:05.000 0 0 True1 2009-05-10 10:43:33.000 2009-05-10 16:54:50.000 0 0 True1 2009-05-11 07:08:42.000 2009-05-11 13:41:42.000 0 0 True1 2009-05-11 13:41:50.000 2009-05-11 13:42:46.000 0 0 True1 2009-05-11 13:42:53.000 2009-05-11 15:03:17.000 0 0 True1 2009-05-12 06:58:05.000 2009-05-12 15:12:41.000 0 0 True1 2009-05-13 06:59:51.000 2009-05-13 15:30:54.000 0 0 True1 2009-05-15 14:49:28.000 2009-05-15 23:31:17.000 0 0 True |
 |
|
Sachin.Nand
2937 Posts |
Posted - 2010-08-16 : 08:09:56
|
quote: Originally posted by roko1234 1 2009-05-10 07:26:40.000 2009-05-10 10:43:05.000 0 0 True1 2009-05-10 10:43:33.000 2009-05-10 16:54:50.000 0 0 True1 2009-05-11 07:08:42.000 2009-05-11 13:41:42.000 0 0 True1 2009-05-11 13:41:50.000 2009-05-11 13:42:46.000 0 0 True1 2009-05-11 13:42:53.000 2009-05-11 15:03:17.000 0 0 True1 2009-05-12 06:58:05.000 2009-05-12 15:12:41.000 0 0 True1 2009-05-13 06:59:51.000 2009-05-13 15:30:54.000 0 0 True1 2009-05-15 14:49:28.000 2009-05-15 23:31:17.000 0 0 True
So is the logic to get the desired o/p you posted with the above data?Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless. PBUH |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-08-16 : 09:39:42
|
What are "0", "0" and "TRUE"? N 56°04'39.26"E 12°55'05.63" |
 |
|
|
|
|